#include <bits/stdc++.h>
using namespace std;
int main() {
  char xxx[26];
  string x, xx, a;
  cin >> x >> xx >> a;
  for (int i = 0; i < 26; i++) {
    xxx[x[i] - 'a'] = xx[i];
  }
  for (int i = 0; i < a.size(); i++) {
    if (a[i] >= 'a' && a[i] <= 'z')
      cout << xxx[a[i] - 'a'];
    else if (a[i] >= 'A' && a[i] <= 'Z')
      cout << (char)(xxx[a[i] - 'A'] - 32);
    else
      cout << a[i];
  }
  return 0;
}
