#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  string s;
  string s1;
  cin >> s >> s1;
  map<char, char> m;
  for (long long int i = 0; i < 26; i++) {
    m[s[i]] = s1[i];
  }
  string s2;
  cin >> s2;
  for (long long int i = 0; i < s2.length(); i++) {
    if (s2[i] < 60) {
      cout << s2[i];
      continue;
    }
    if (s2[i] < 91 && s2[i] > 60) {
      cout << char(m[char(s2[i] + 32)] - 32);
      continue;
    }
    cout << m[s2[i]];
  }
}
