#include<cstdio>
#include<cstring>
using namespace std;
int i,j;
int b[210],a[55][55];
char key[110],c[1010];
int main(){
freopen("vigenere.in","r",stdin);
freopen("vigenere.out","w",stdout);
for (i=1;i<=26;i++)
for (j=1;j<=26;j++)
{a[i][j]=(j+1-i+26)%26; if (a[i][j]==0) a[i][j]=26;}
for (i=65;i<=90;i++) b[i]=64;
for (i=97;i<=122;i++) b[i]=96;
scanf("%s%s",&key,&c);
for (i=0;i<strlen(c);i++){
int t=a[key[i%strlen(key)]-b[key[i%strlen(key)]]][c[i]-b[c[i]]];
if (c[i]>=97) putchar(t+96); else putchar(t+64);
}
return 0;
}