#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  map<char, char> to;
  string s1, s2, s3;
  cin >> s1 >> s2 >> s3;
  for (int i = 0; i < s1.size(); ++i) {
    to[s1[i]] = s2[i];
  }
  for (char c : s3) {
    if (!isalpha(c))
      cout << c;
    else {
      if (islower(c))
        cout << to[c];
      else {
        char a = to[tolower(c)];
        cout << char(toupper(a));
      }
    }
  }
  return 0;
}
