#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, j;
  string a, b, c;
  cin >> a >> b >> c;
  for (i = 0; i < c.size(); i++) {
    for (j = 0; j < a.size(); j++) {
      if (c[i] == a[j] || c[i] == a[j] - 32) {
        if (c[i] >= 65 && c[i] <= 90)
          cout << (char)(b[j] - 32);
        else
          cout << b[j];
      }
    }
    if (c[i] >= 48 && c[i] <= 57) cout << c[i];
  }
  cout << endl;
  return 0;
}
