#include <bits/stdc++.h>
using namespace std;
int main() {
  unsigned char a1[100], a2[100], s[1024];
  cin >> a1 >> a2 >> s;
  int tr[256], l = 'A' - 'a';
  for (int i = 0; i < 256; ++i) tr[i] = i;
  for (int i = 0; i < 26; ++i) {
    tr[a1[i] + 0] = a2[i] + 0;
    tr[a1[i] + l] = a2[i] + l;
  }
  for (int i = 0; i < 1000 && s[i]; ++i) s[i] = tr[s[i]];
  cout << s << "\n";
  return 0;
}
