#include <bits/stdc++.h>
using namespace std;
int main() {
  string s, t, r = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
  int i;
  cin >> s >> t;
  for (i = 0; i < 26; ++i) r[s[i] - 'a'] = t[i];
  cin >> s;
  for (i = 0; i < s.size(); ++i)
    if ('a' <= s[i] && s[i] <= 'z')
      s[i] = r[s[i] - 'a'];
    else if ('A' <= s[i] && s[i] <= 'Z')
      s[i] = r[s[i] - 'A'] - 32;
  cout << s;
}
