#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++) {
    if ((c[i] >= 'a') && (c[i] <= 'z')) {
      int j = 0;
      while (a[j] != c[i]) {
        j = j + 1;
      }
      cout << b[j];
      continue;
    }
    if ((c[i] >= 'A') && (c[i] <= 'Z')) {
      int j = 0;
      char Z = c[i] - 'A' + 'a';
      while (a[j] != Z) {
        j = j + 1;
      }
      cout << char(b[j] + 'A' - 'a');
      continue;
    }
    cout << c[i];
  }
}
