#include <bits/stdc++.h>
using namespace std;
int main() {
  string a, b, c;
  cin >> a >> b >> c;
  for (int i = 0; i < c.size(); i++) {
    for (int j = 0; j < 26; j++) {
      if (c[i] == a[j]) {
        c[i] = b[j];
        break;
      }
      if (c[i] == a[j] - 32) {
        c[i] = b[j] - 32;
        break;
      }
    }
  }
  cout << c;
}
