#include <bits/stdc++.h>
using namespace std;
template <typename Arg1>
vector<Arg1> readVector(Arg1 n);
int main() {
  string first, second, input;
  cin >> first >> second >> input;
  char trans[26];
  int start = 'a';
  for (int i = 0; i < first.size(); i++) {
    int index = int(first.at(i)) - start;
    trans[index] = second[i];
  }
  for (char c : input) {
    if ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z')) {
      if (c <= 'Z') {
        cout << char(trans[int(c) - 'A'] - ('a' - 'A'));
      } else {
        cout << trans[int(c) - start];
      }
    } else {
      cout << c;
    }
  }
}
