#include <iostream>
#include <cstring>
#include <cstdio>

using namespace std;


int toDec(char c){	
	if(c=='a') return 10;
	if(c=='b') return 11;
	if(c=='c') return 12;
	if(c=='d') return 13;
	if(c=='e') return 14;
	if(c=='f') return 15;
	
	return c-'0';
}

char dec(string key, string cipher, int x){
	int k = key[x%key.length()];
	int c = toDec(cipher[x*2])*16 + toDec(cipher[x*2+1]);
	return (char) k^c;
	
}

int main(){
	//freopen("test.in","r",stdin);
	string cipher;
	string key;
	getline(cin, key);
	getline(cin,cipher);
	string plain;
	for(int i=0; i<cipher.length()/2; i++){
		plain+= dec(key,cipher,i);
	}
	cout << plain << endl;
	return 0;
}