#include <bits/stdc++.h>
using namespace std;
int main() {
  string s1, s2;
  string s3;
  while (cin >> s1 >> s2 >> s3) {
    map<char, int> m;
    for (int i = 0; i < 26; ++i) {
      m[s1[i]] = i;
    }
    for (int i = 0; i < s3.size(); i++) {
      if (s3[i] >= 'A' && s3[i] <= 'Z') {
        printf("%c", s2[m[s3[i] - 'A' + 'a']] - 'a' + 'A');
      } else if (s3[i] >= 'a' && s3[i] <= 'z') {
        printf("%c", s2[m[s3[i]]]);
      } else
        printf("%c", s3[i]);
    }
    cout << endl;
  }
  return 0;
}
