#include <bits/stdc++.h>
using namespace std;
int main() {
  string a, b, s;
  getline(cin, a);
  getline(cin, b);
  getline(cin, s);
  for (int i = 0; i < s.length(); ++i) {
    size_t pos = a.find(tolower(s[i]));
    if (pos != string::npos) {
      if ('A' <= s[i] && s[i] <= 'Z') {
        s[i] = toupper(b[pos]);
      } else {
        s[i] = b[pos];
      }
    }
  }
  cout << s;
}
