#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  t = 1;
  while (t--) {
    string s1, s2, s3;
    cin >> s1 >> s2 >> s3;
    int n = s1.length();
    map<char, char> mp;
    for (int i = 0; i < n; i++) {
      mp[s1[i]] = s2[i];
    }
    n = s3.length();
    for (int i = 0; i < n; i++) {
      if (s3[i] <= 92 && s3[i] >= 65) {
        char s = mp[s3[i] + 32] - 32;
        cout << s;
      } else if (mp.find(s3[i]) != mp.end())
        cout << mp[s3[i]];
      else
        cout << s3[i];
    }
    cout << endl;
  }
  return 0;
}
