#include <bits/stdc++.h>
using namespace std;
string s1, s2, t;
int n;
int main(int argc, char** argv) {
  cin >> s1 >> s2 >> t;
  for (int i = 0; i < t.length(); i++) {
    if (!isalpha(t[i])) {
      cout << t[i];
    } else {
      for (int j = 0; j < 26; j++) {
        if (char(tolower(t[i])) == s1[j]) {
          if (islower(t[i]))
            cout << s2[j];
          else
            cout << char(toupper(s2[j]));
        }
      }
    }
  }
  return 0;
}
