#include <bits/stdc++.h>
int main() {
  std::string s1, s2, t;
  std::cin >> s1 >> s2 >> t;
  std::map<char, char> m;
  for (int i = 0; i < s1.size(); ++i) {
    m[s1[i]] = s2[i];
  }
  for (int i = 0; i < t.size(); ++i) {
    if (t[i] <= 'z' && t[i] >= 'a') {
      std::cout << m[t[i]];
    } else if (t[i] <= 'Z' && t[i] >= 'A') {
      std::cout << static_cast<char>(m[t[i] - 'A' + 'a'] - 'a' + 'A');
    } else {
      std::cout << t[i];
    }
  }
  std::cout << std::endl;
  return 0;
}
