#include <bits/stdc++.h>
using namespace std;
struct da {
  char slovo;
  char pret;
};
char niz1[26];
char niz2[26];
da niz[26];
int main() {
  char c;
  for (int i = 0; i < 26; i++) {
    cin >> c;
    niz1[i] = c;
  }
  for (int i = 0; i < 26; i++) {
    cin >> c;
    niz2[i] = c;
  }
  string s;
  cin >> s;
  for (int i = 0; i < 26; i++) {
    niz[i].slovo = niz2[i];
    niz[i].pret = niz1[i];
  }
  for (int i = 0; i < s.length(); i++) {
    if (s[i] >= 'a' && s[i] <= 'z') {
      for (int j = 0; j < 26; j++) {
        if (s[i] == niz[j].pret) {
          cout << niz[j].slovo;
          break;
        }
      }
    } else if (s[i] >= 'A' && s[i] <= 'Z') {
      for (int j = 0; j < 26; j++) {
        if (s[i] == toupper(niz[j].pret)) {
          niz[j].slovo = toupper(niz[j].slovo);
          cout << niz[j].slovo;
          niz[j].slovo = tolower(niz[j].slovo);
          break;
        }
      }
    } else
      cout << s[i];
  }
  return 0;
}
