#include <bits/stdc++.h>
using namespace std;
int vf[10000];
string s1, s2, s3;
int main() {
  cin >> s1 >> s2;
  for (int i = 0; i < s1.size(); i++) {
    vf[s1[i]] = i;
    vf[s1[i] - 'a' + 'A'] = i;
  }
  cin >> s3;
  for (int i = 0; i < s3.size(); i++) {
    if (s3[i] >= 'A' && s3[i] <= 'Z') {
      cout << (char)(s2[vf[s3[i]]] - 'a' + 'A');
    } else if (s3[i] >= 'a' && s3[i] <= 'z') {
      cout << (char)(s2[vf[s3[i]]]);
    } else
      cout << s3[i];
  }
  return 0;
}
