#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int l, u, n, i = 0, mul = 1, m = 0, c = 0, x, y, j = -1, k = 0,
                         sum = 0, s = 0, mx = 0;
  char f[1000];
  char b[1000];
  char w[1005];
  map<char, char> a;
  cin >> b;
  cin >> w;
  for (i = 0; i < 26; i++) {
    a[b[i]] = w[i];
  }
  cin >> f;
  c = strlen(f);
  for (i = 0; i < c; i++) {
    if (f[i] >= 'A' && f[i] <= 'Z') {
      f[i] = f[i] + 32;
      f[i] = a[f[i]] - 32;
      cout << f[i];
    } else if (f[i] >= 'a' && f[i] <= 'z')
      cout << a[f[i]];
    else
      cout << f[i];
  }
  return 0;
}
