#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e18 + 1;
string a, b, c;
map<char, char> w;
int main() {
  cin >> a >> b >> c;
  for (int i = 0; i < a.size(); i++) {
    w[a[i]] = b[i];
    w[toupper(a[i])] = toupper(b[i]);
  }
  for (int i = 0; i < c.size(); i++) {
    if (c[i] >= '0' && c[i] <= '9')
      cout << c[i];
    else
      cout << w[c[i]];
  }
  return 0;
}
