#include <cstdio>
#include <iostream>
#include <cstring>
#include <algorithm>

using namespace std;

int pot16 [ 20 ];

int todecimal ( string heks ){
   int ret = 0;
   for ( int i = 0; i < heks.size(); ++i )
      if ( isdigit(heks[i]) )
         ret += ( heks[i] - '0' ) * pot16[heks.size()-i-1];
      else
         ret += ( heks[i] - 'A' + 10 ) * pot16[heks.size()-i-1];
   return ret;
}

int N;
bool space [ 35 ];
bool let [ 35 ];
string heks;
char in [ 20 ];

int main ( void ){
   pot16[0] = 1;
   for ( int i = 1; i < 7; ++i )
      pot16[i] = pot16[i-1] * 16;
      
   for ( char ch = 'a'; ch <= 'z'; ++ch )
      for ( char k = '0'; k <= '9'; ++k )
         let[int(ch)^int(k)] = true;
      
   scanf("%d",&N);
   for ( int i = 0; i < N; ++i ){
      scanf("%s",in);
      heks = in;
      if ( let[todecimal(heks)] )
         printf("-");
      else
         printf(".");
   }
      
   return 0;
}
