#include <bits/stdc++.h>
using namespace std;
map<char, char> d;
int main() {
  string s, t, a;
  cin >> s >> t >> a;
  for (int i = 0; i < 26; ++i) d[s[i]] = t[i];
  for (auto& c : a) {
    if (!isalpha(c))
      cout << c;
    else if (isupper(c))
      cout << char(toupper(d[tolower(c)]));
    else
      cout << d[c];
  }
  return 0;
}
