#include <bits/stdc++.h>
using namespace std;
int main() {
  string st1, st2, st3, s;
  cin >> st1 >> st2 >> st3;
  for (int i = 0; i < st3.size(); i++) {
    if (st3[i] >= 48 && st3[i] <= 57) {
      s += st3[i];
    } else {
      for (int j = 0; j < 26; j++) {
        if (st3[i] == st1[j]) {
          s += st2[j];
          break;
        }
        if (st3[i] + 32 == st1[j]) {
          s += st2[j] - 32;
          break;
        }
      }
    }
  }
  cout << s << endl;
}
