#include <bits/stdc++.h>
using namespace std;
int main() {
  string x, y, s;
  string a = "";
  cin >> x >> y >> s;
  for (int i = 0; i < s.length(); i++) {
    if (isupper(s[i]) == 1) {
      char t = toupper(y[x.find(tolower(s[i]))]);
      a = a + t;
    } else if (islower(s[i])) {
      a = a + y[x.find(tolower(s[i]))];
    } else {
      a = a + s[i];
    }
  }
  cout << a << endl;
  return 0;
}
