#include <bits/stdc++.h>
using namespace std;
string str[200001];
int main() {
  int i;
  map<char, char> m;
  string s, ss, t;
  cin >> s >> t >> ss;
  for (i = 0; i < 26; i++) {
    m[s[i]] = t[i];
  }
  for (i = 0; i < ss.length(); i++) {
    if (ss[i] >= '0' && ss[i] <= '9')
      cout << ss[i];
    else if (ss[i] >= 'A' && ss[i] <= 'Z') {
      char ch = toupper(m[ss[i] - 'A' + 'a']);
      cout << ch;
    } else
      cout << m[ss[i]];
  }
  cout << endl;
  return 0;
}
