#include <bits/stdc++.h>
using namespace std;
int a[4];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  string s, t;
  cin >> s >> t;
  string a;
  cin >> a;
  for (int i = 0; i < a.size(); i++) {
    size_t f = s.find(tolower(a[i]));
    if (s.find(tolower(a[i])) == string::npos)
      cout << a[i];
    else if (isupper(a[i]))
      cout << (char)toupper(t[f]);
    else
      cout << t[f];
  }
  return 0;
}
