#include <bits/stdc++.h>
using namespace std;
string s, t, a;
map<char, int> pos;
int main() {
  cin >> s >> t >> a;
  for (int i = 0; i < 26; ++i) {
    pos[s[i]] = i;
  }
  for (int i = 0; i < a.size(); ++i) {
    if (!isalpha(a[i]))
      cout << a[i];
    else {
      char x = tolower(a[i]);
      x = t[pos[x]];
      if (isupper(a[i])) x = toupper(x);
      cout << x;
    }
  }
  return 0;
}
