#include <bits/stdc++.h>
using namespace std;
bool mark[1000];
int main() {
  int n, l1, i;
  string a, b, c;
  cin >> a >> b >> c;
  n = c.size();
  for (i = 0; i < n; i++) {
    if (c[i] < 58)
      cout << c[i];
    else {
      for (int j = 0; j < 26; j++) {
        if (c[i] == a[j] || c[i] == a[j] - 32) {
          if (c[i] < 95) {
            printf("%c", b[j] - 32);
          } else
            cout << b[j];
          break;
        }
      }
    }
  }
}
