#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  long long int t = 1;
  while (t--) {
    long long int n;
    string s, t, u;
    cin >> s >> t >> u;
    map<char, char> mp;
    for (char i = '0'; i <= '9'; i++) {
      mp[i] = i;
    }
    for (long long int i = 0; i < 26; i++) {
      mp[s[i]] = t[i];
      if (s[i] >= 'a' && s[i] <= 'z') mp[s[i] - 'a' + 'A'] = (t[i] - 'a' + 'A');
      if (s[i] >= 'A' && s[i] <= 'Z') mp[s[i] + 'a' - 'A'] = (t[i] + 'a' - 'A');
    }
    for (long long int i = 0; i < u.size(); i++) cout << mp[u[i]];
  }
  return 0;
}
