#include <iostream>
using namespace std;
int main()
{
string m, k, c;
cin >> k >> c;
while (k.size() < c.size())
k += k;
for (int i = 0; k[i]; i++)
if (k[i] <= 90)
k[i] += 32;
for (int i = 0; c[i]; i++)
{
int n = c[i] - k[i] + 'a';
if (c[i] < 91)
{
if (n < 65)
putchar(n + 26);
else
putchar(n);
}
else
{
if (n < 97)
putchar(n + 26);
else
putchar(n);
}
}
return 0;
}