#include <bits/stdc++.h>
using namespace std;
const long double eps = 1e-6;
int n;
int a[100005];
vector<int> ve;
map<char, char> mp;
int main() {
  string a, b, s;
  cin >> a >> b >> s;
  for (int i = 0; i < a.size(); i++) {
    mp[a[i]] = b[i];
    mp[toupper(a[i])] = toupper(b[i]);
  }
  for (char i = '0'; i <= '9'; i++) mp[i] = i;
  for (int i = 0; i < s.size(); i++) cout << mp[s[i]];
}
