#include <cmath> #include <cstdio> #include <vector> #include <iostream> #include <algorithm> #include <memory.h> using namespace std; char key[2010], text[2010]; int c(char z) { if ('0' <= z && z <= '9') return z - '0'; return z - 'a' + 10; } int main() { scanf("%s", key); scanf("%s", text); int k = strlen(key); int n = strlen(text); int j = 0; for (int i = 0; i < n; i += 2) { int code = c(text[i]) * 16 + c(text[i+1]); // printf("%d ", code); code ^= key[j]; j = (j + 1) % k; putchar(code); } return 0; }