#include <bits/stdc++.h>
using namespace std;
int main() {
  string s, s1, str;
  cin >> s >> s1 >> str;
  for (int i = 0; i < str.size(); ++i) {
    if (str[i] >= 'a')
      str[i] = s1[s.find(str[i])];
    else if (str[i] >= 'A')
      str[i] = toupper(s1[s.find(tolower(str[i]))]);
  }
  cout << str;
  return 0;
}
