#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
void solve() {
  string a, b, t;
  cin >> a >> b >> t;
  char conv[26];
  for (long long i = 0; i < 26; i++) {
    conv[a[i] - 'a'] = b[i];
  }
  for (long long i = 0; i < t.size(); i++) {
    if (not isalpha(t[i]))
      cout << t[i];
    else if (isupper(t[i])) {
      t[i] = conv[t[i] + 32 - 'a'] - 32;
      cout << t[i];
    } else {
      t[i] = conv[t[i] - 'a'];
      cout << t[i];
    }
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  int number_of_cases___ = 1;
  while (number_of_cases___--) solve();
}
