#include <bits/stdc++.h>
using namespace std;
int main() {
  string s, s1, s2;
  int i, j, l;
  char temp;
  while (cin >> s1) {
    cin >> s2;
    cin >> s;
    l = s.size();
    for (i = 0; i < l; i++) {
      if (s[i] >= 'a' && s[i] <= 'z') {
        temp = s[i];
        for (j = 0; j < 26; j++) {
          if (s1[j] == temp) {
            s[i] = s2[j];
            break;
          }
        }
      } else if (s[i] >= 'A' && s[i] <= 'Z') {
        temp = s[i] + 32;
        for (j = 0; j < 26; j++) {
          if (s1[j] == temp) {
            s[i] = s2[j] - 32;
            break;
          }
        }
      }
    }
    cout << s << endl;
  }
  return 0;
}
