#include <bits/stdc++.h>
using namespace std;
int j, mode;
string str0, str1, str_in, str_out;
int main() {
  cin >> str0 >> str1 >> str_in;
  for (int i = 0; i < str_in.size(); i++) {
    if (str_in[i] <= '9' && str_in[i] >= 0)
      str_out += str_in[i];
    else {
      j = 0;
      for (j; j < str0.size(); j++) {
        if (str_in[i] <= 'z' && str_in[i] == str0[j]) {
          mode = 1;
          break;
        }
        if (str_in[i] - 'A' + 'a' == str0[j]) {
          mode = 2;
          break;
        }
      }
      if (mode == 1) {
        str_out += str1[j];
      } else {
        str_out += str1[j] - 'a' + 'A';
      }
    }
  }
  cout << str_out;
}
