#include <bits/stdc++.h>
using namespace std;
int main() {
  string s1, s2, t;
  cin >> s1 >> s2 >> t;
  int i, j;
  for (i = 0; i < t.length(); i++) {
    char cc = tolower(t[i]);
    for (j = 0; j < 26; j++) {
      if (s1[j] == cc) {
        if (t[i] >= 'a' && t[i] <= 'z') {
          cout << s2[j];
        } else if (t[i] >= 'A' && t[i] <= 'Z') {
          char c = toupper(s2[j]);
          cout << c;
        }
      } else if (t[i] >= '0' && t[i] <= '9') {
        cout << t[i];
        break;
      }
    }
  }
  cout << endl;
}
