#include <bits/stdc++.h>
using namespace std;
int main() {
  signed long long t, n, i, l, y, z, sum1, sum2, x, f, m, j, r, sum, k, d, num,
      q, h, u, v, np, nl, b, p, c;
  string s1, s2, s3, s4;
  cin >> s1 >> s2;
  map<char, char> mp;
  for (i = 0; i < 26; i++) {
    mp[s1[i]] = s2[i];
  }
  cin >> s3;
  s4 = s3;
  transform(s4.begin(), s4.end(), s4.begin(), ::tolower);
  for (i = 0; i < s4.length(); i++) {
    if (isalpha(s4[i])) {
      if (s3[i] >= 'a' && s3[i] <= 'z') {
        s4[i] = mp[s4[i]];
      } else {
        s4[i] = mp[s4[i]] - 32;
      }
    }
  }
  cout << s4;
  return 0;
}
