#include <bits/stdc++.h>
using namespace std;
int main() {
  string s1, s2;
  cin >> s1 >> s2;
  map<char, char> m;
  for (int i = 0; i < 26; i++) {
    m[s1[i]] = s2[i];
    m[toupper(s1[i])] = toupper(s2[i]);
  }
  string s3;
  cin >> s3;
  for (int i = 0; i < s3.size(); i++) {
    if (s3[i] >= '0' && s3[i] <= '9')
      cout << s3[i];
    else
      cout << m[s3[i]];
  }
  cout << endl;
}
