#include <stdio.h>


int main(int argc, char **argv){
    FILE *fin;
    char s;
    char *t=argv[2];
    printf("%s\n", t); 

    fin=fopen(argv[1], "r");
    fscanf(fin,"%c", &s);
    while(!feof(fin)){
        if (s>='A' && s<='Z') s=s-'A'+'a';
        if (s>='a' && s<='z')
    		s=t[s-'a'];
        printf("%c",s);
        fscanf(fin, "%c", &s);
	}

	return 0;
}
