#include <bits/stdc++.h>
int main() {
  static char ss[32], tt[32], cc[1024];
  static int ii[26];
  int n, i;
  scanf("%s", ss);
  scanf("%s", tt);
  for (i = 0; i < 26; i++) ii[ss[i] - 'a'] = i;
  scanf("%s", cc);
  n = strlen(cc);
  for (i = 0; i < n; i++)
    if (isalpha(cc[i])) {
      int j = tolower(cc[i]) - 'a';
      printf("%c", isupper(cc[i]) ? toupper(tt[ii[j]]) : tt[ii[j]]);
    } else
      printf("%c", cc[i]);
  printf("\n");
  return 0;
}
