#include <bits/stdc++.h>
using namespace std;
int main() {
  string s1, s2, s, g;
  map<char, char> mp;
  cin >> s1 >> s2 >> s;
  for (int i = 0; i < 26; i++) {
    mp[s1[i]] = s2[i];
  }
  for (int i = 0; i < s.size(); i++) {
    if (isdigit(s[i])) {
      g += s[i];
    } else {
      if (isupper(s[i])) {
        s[i] = tolower(s[i]);
        g += toupper(mp[s[i]]);
      } else {
        g += mp[s[i]];
      }
    }
  }
  cout << g << endl;
  return 0;
}
