#include <bits/stdc++.h>
using namespace std;
map<char, char> m;
string str, layoutone, layouttwo;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long int i, j;
  cin >> layoutone >> layouttwo >> str;
  for (i = 0; i < 26; i++) {
    m[layoutone[i]] = layouttwo[i];
  }
  for (auto val : str) {
    if (val >= '0' && val <= '9')
      cout << val;
    else if (isupper(val)) {
      cout << (char)toupper(m[(char)tolower(val)]);
    } else {
      cout << m[val];
    }
  }
  cout << '\n';
  return 0;
}
