#include <bits/stdc++.h>
using namespace std;
int main() {
  map<char, char> m;
  string p, q, x;
  char c;
  int i;
  cin >> p;
  cin >> q;
  cin >> x;
  for (c = '0'; c <= '9'; c++) m[c] = c;
  for (i = 0; i < 26; i++) {
    m[p[i]] = q[i];
    m[p[i] - 'a' + 'A'] = q[i] - 'a' + 'A';
  }
  for (i = 0; i < x.length(); i++) x[i] = m[x[i]];
  cout << x << endl;
}
