#include <bits/stdc++.h>
using namespace std;
map<int, int> mp;
int main() {
  char s1[30], s2[30];
  scanf("%s", s1);
  scanf("%s", s2);
  int len = strlen(s1);
  mp.clear();
  for (int i = 0; i < len; i++) {
    mp[s1[i] - 'a'] = s2[i] - 'a';
  }
  char s[1005];
  scanf("%s", s);
  for (int i = 0; i < strlen(s); i++) {
    if (s[i] >= 'A' && s[i] <= 'Z') {
      int x = s[i] - 'A';
      putchar('A' + mp[x]);
      continue;
    }
    if (s[i] >= 'a' && s[i] <= 'z') {
      int x = s[i] - 'a';
      putchar('a' + mp[x]);
      continue;
    }
    putchar(s[i]);
  }
  puts("");
  return 0;
}
