#define debug if(1) #include #include #define REP(i,n) for(int i = 0; i < int(n); i++) const int maxn = 100100; int n,m; char text[maxn]; char cipher[maxn]; char res[maxn]; const int s = 'Z' - 'A' + 1; int main() { while(true) { scanf("%s", cipher); if(strcmp(cipher,"0") == 0) break; scanf("%s", text); n = strlen(text); m = strlen(cipher); int j = 0; REP(i,n) { res[i] = 'A' + ((text[i] - 'A') + (cipher[j] - 'A') + 1) % s; j = (j + 1) % m; } res[n] = 0; printf("%s\n", res); } return 0; }