#include <bits/stdc++.h>
using namespace std;
int main() {
  string a, s;
  cin >> a >> s;
  string d;
  cin >> d;
  int T = d.size();
  for (int i = 0; i < T; i++) {
    for (int j = 0; j < a.size(); j++) {
      if ((d[i] == a[j]) || (d[i] - 65 + 97 == a[j])) {
        if (d[i] < 96) {
          d[i] = s[j] - 97 + 65;
          break;
        } else {
          d[i] = s[j];
          break;
        }
      }
    }
  }
  cout << d << endl;
  return 0;
}
