#include <bits/stdc++.h>
using namespace std;
int c[1000];
int h[1000];
const int ch = 'a' - 'A';
int main() {
  char c1[50];
  cin >> c1;
  for (int i = 0; i < 26; i++) {
    c[c1[i]] = i;
  }
  cin >> c1;
  char ahr[1001];
  cin >> ahr;
  int l = strlen(ahr);
  for (int i = 0; i < l; i++) {
    if (ahr[i] <= 'z' && ahr[i] >= 'a')
      printf("%c", c1[c[ahr[i]]]);
    else if (ahr[i] <= 'Z' && ahr[i] >= 'A')
      printf("%c", c1[c[ahr[i] + ch]] - ch);
    else
      cout << ahr[i];
  }
  return 0;
}
