#include <bits/stdc++.h>
using namespace std;
int main() {
  string s, t, str;
  cin >> s >> t >> str;
  map<char, char> mp;
  for (int i = 0; i < s.length(); i++) {
    mp[s[i]] = t[i];
  }
  for (int i = 0; i < str.length(); i++) {
    char c = std::tolower(str[i]);
    char converted = mp[c];
    if (std::isalpha(str[i])) {
      if (std::isupper(str[i]))
        str[i] = std::toupper(converted);
      else
        str[i] = converted;
    }
  }
  cout << str << endl;
}
