// Verdict :: Accepted
/// Header file begin
#include <iostream>
#include <cstdio>
#include <cstring>
#include <map>
#include <string>
#include <vector>
#include <cmath>
#include <cctype>
#include <sstream>
#include <set>
#include <list>
#include <stack>
#include<utility>
#include <queue>
#include <algorithm>
/// End
//..........
/// Macro
#define sf scanf
#define pf printf
#define sfint(a,b) scanf("%d %d",&a,&b)
#define sfl(a,b) scanf("%ld %ld",&a,&b)
#define sfll(a,b) scanf("%lld %lld",&a,&b)
#define sfd(a,b) scanf("%lf %lf",&a,&b)
#define sff(a,b) scanf("%f %f",&a,&b)
#define lp1(i,n) for(i=0;i<n;i++)
#define lp2(i,n) for(i=1;i<=n;i++)
#define mem(c,v) memset(c,v,sizeof(c))
#define cp(a) cout<<" "<<a<<" "<<endl
#define nl puts("")
#define sq(x) ((x)*(x))
#define all(x) x.begin(),x.end()
#define sz size()
#define gc getchar()
#define pb push_back
/// End.........
/// Size
#define mx7 20000100
#define mx6 1500000
#define mx5 100005
#define mx4 1000100
#define inf 1<<30 //infinity value
#define eps 1e-9
#define mx (65540)
#define mod 1000000007
#define pi acos(-1.0)
/// Macros for Graph
#define white 0
#define gray 1
#define black -1
#define nil -2
using namespace std;
//..................................................................................................................
typedef long long LL;
typedef long L;
typedef unsigned long long ull;
typedef unsigned long ul;
typedef unsigned int ui;
typedef pair<int, int> pii;
template<class T> T gcd(T a, T b ) {return b<=0?a:gcd(b,a%b);}
template<class T> T large(T a, T b ) {return a>b?a:b;}
template<class T> T small(T a, T b ) {return a<b?a:b;}
template<class T> T diffrnce(T a, T b) {return a-b<0?b-a:a-b;}
struct my
{
int key,hm;
};
my ar[1000+5];
char RTC(int k, int h)
{
if(k==1)
{
switch(h)
{
case 1:
return '.';
break;
case 2:
return ',';
break;
case 3:
return '?';
break;
case 4:
return '"';
break;
}
}
else if(k==2)
{
switch(h)
{
case 1:
return 'a';
break;
case 2:
return 'b';
break;
case 3:
return 'c';
break;
}
}
else if(k==3)
{
switch(h)
{
case 1:
return 'd';
break;
case 2:
return 'e';
break;
case 3:
return 'f';
break;
}
}
else if(k==4)
{
switch(h)
{
case 1:
return 'g';
break;
case 2:
return 'h';
break;
case 3:
return 'i';
break;
}
}
else if(k==5)
{
switch(h)
{
case 1:
return 'j';
break;
case 2:
return 'k';
break;
case 3:
return 'l';
break;
}
}
else if(k==6)
{
switch(h)
{
case 1:
return 'm';
break;
case 2:
return 'n';
break;
case 3:
return 'o';
break;
}
}
else if(k==7)
{
switch(h)
{
case 1:
return 'p';
break;
case 2:
return 'q';
break;
case 3:
return 'r';
break;
case 4:
return 's';
break;
}
}
else if(k==8)
{
switch(h)
{
case 1:
return 't';
break;
case 2:
return 'u';
break;
case 3:
return 'v';
break;
}
}
else if(k==9)
{
switch(h)
{
case 1:
return 'w';
break;
case 2:
return 'x';
break;
case 3:
return 'y';
break;
case 4:
return 'z';
break;
}
}
else if(k==0)
{
switch(h)
{
case 1:
return ' ';
break;
case 2:
return ' ';
break;
case 3:
return ' ';
break;
case 4:
return ' ';
break;
case 5:
return ' ';
break;
case 6:
return ' ';
break;
case 7:
return ' ';
break;
case 8:
return ' ';
break;
case 9:
return ' ';
break;
}
}
}
int main()
{
int t;
sf("%d\n",&t);
while(t--)
{
int lngth,arlen=0;
sf("%d",&lngth);
for(int i=0;i<lngth;i++)
{
sf("%d",&ar[i].key);
}
for(int i=0;i<lngth;i++)
{
sf("%d",&ar[i].hm);
}
//for(int i=0;i<lngth;i++)cout << ar[i].key << " " << ar[i].hm << endl;
getchar();
for(int i=0;i<lngth;i++)
{
//char ch=RTC(ar[i].key,ar[i].hm);
pf("%c",RTC(ar[i].key,ar[i].hm));
}
nl;
}
return 0;
}
/*
12
4 6 9 0 2 7 3 0 9 6 8 1
2 3 1 1 1 3 2 1 3 3 2 3
*/
Comments
Post a Comment