#include <bits/stdc++.h>
using namespace std;
int main() {
  string s1, s2;
  cin >> s1 >> s2;
  map<char, char> mp;
  for (int i = 0; i < s1.length(); i++) {
    mp[s1[i]] = s2[i];
  }
  string s3, s;
  cin >> s;
  for (int i = 0; i < s.length(); i++) {
    if (isalpha(s[i])) {
      if (s[i] >= 65 && s[i] <= 90) {
        s[i] = (s[i] % 65) + 97;
        char c = mp[s[i]] - 32;
        s3 = s3 + c;
      } else {
        s3 = s3 + mp[s[i]];
      }
    } else if (isdigit(s[i])) {
      s3 += s[i];
    }
  }
  cout << s3;
}
