#include <bits/stdc++.h>
using namespace std;
map<char, int> letter1, letter2;
map<int, char> numb1, numb2;
int main() {
  string s;
  cin >> s;
  for (int i = 0; i < 26; i++) {
    letter1[s[i]] = i;
    numb1[i] = s[i];
  }
  cin >> s;
  for (int i = 0; i < 26; i++) {
    letter2[s[i]] = i;
    numb2[i] = s[i];
  }
  cin >> s;
  for (int i = 0; i < (int)s.size(); i++) {
    int r = 0;
    if (s[i] >= 'A' && s[i] <= 'Z') {
      s[i] = (char)((int)s[i] + 32);
      r = 32;
    }
    if (s[i] >= '0' && s[i] <= '9') {
      cout << s[i];
      continue;
    }
    cout << char((int)numb2[letter1[s[i]]] - r);
  }
  return 0;
}
