#include <bits/stdc++.h>
using namespace std;
int main() {
  string a, b, c;
  cin >> a >> b >> c;
  map<char, char> m;
  for (int i = 0; i < 26; i++) {
    m[a[i]] = b[i];
  }
  for (int i = 0; i < c.size(); i++) {
    if (c[i] >= 'A' && c[i] <= 'Z') {
      char p = tolower(c[i]);
      p = m[p];
      printf("%c", toupper(p));
    } else if (c[i] >= 'a' && c[i] <= 'z') {
      cout << m[c[i]];
    } else {
      cout << c[i];
    }
  }
}
