#include <bits/stdc++.h>
using namespace std;
int main() {
  int a[200] = {0};
  char b[30], c[30], d[10000];
  cin >> b >> c >> d;
  for (int i = 0; i < 26; i++) {
    a[b[i]] = c[i];
  }
  for (int i = 0; i < strlen(d); i++) {
    char x;
    if (d[i] >= 'A' && d[i] <= 'Z') {
      x = a[d[i] + 32] - 32;
      cout << x;
    } else if (d[i] >= 'a' && d[i] <= 'z') {
      x = a[d[i]];
      cout << x;
    } else
      cout << d[i];
  }
}
