#include <bits/stdc++.h>
using namespace std;
int main() {
  string s1, s2;
  cin >> s1;
  cin >> s2;
  string s;
  cin >> s;
  map<char, char> m, c;
  for (int i = 0; i < 26; i++) {
    m[s1[i]] = s2[i];
    int a = s1[i] - 32;
    char b = static_cast<char>(a);
    int p = s2[i] - 32;
    char q = static_cast<char>(p);
    c[b] = q;
  }
  for (int i = 0; i < s.size(); i++) {
    if ((s[i] >= 65) && (s[i] <= 90)) {
      cout << c[s[i]];
    } else if ((s[i] >= 97) && (s[i] <= 122)) {
      cout << m[s[i]];
    } else {
      cout << s[i];
    }
  }
}
