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