#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  string s1, s2, inp;
  cin >> s1 >> s2 >> inp;
  map<char, char> mp;
  for (int i = 0; i < s1.size(); i++) {
    mp[s1[i]] = s2[i];
    mp[s1[i] - 32] = s2[i] - 32;
  }
  for (int i = 0; i < inp.size(); i++) {
    if (inp[i] >= '0' && inp[i] <= '9') {
      cout << inp[i];
    } else {
      cout << mp[inp[i]];
    }
  }
  return 0;
}
