#include <bits/stdc++.h>
using namespace std;
int main() {
  char c1, c2;
  int n1, n2;
  int val1[27];
  int map[27];
  int i;
  for (i = 0; i < 26; i++) {
    cin >> c1;
    n1 = c1;
    val1[i] = n1;
  }
  for (i = 0; i < 26; i++) {
    cin >> c2;
    n2 = c2;
    n1 = val1[i];
    n1 = n1 - 97;
    map[n1] = n2 - 97;
  }
  string s;
  cin >> s;
  char c, pr;
  for (int i1 = 0; i1 < s.length(); i1++) {
    c = s[i1];
    n1 = c;
    if (n1 > 64 && n1 < 91) {
      n1 = n1 - 65;
      n2 = 65 + map[n1];
    } else if (n1 > 96 && n1 < 123) {
      n1 = n1 - 97;
      n2 = 97 + map[n1];
    } else
      n2 = n1;
    pr = n2;
    cout << pr;
  }
  cout << endl;
  return 0;
}
