#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n, k;
  string s;
  cin >> n >> s >> k;
  k--;
  char c;
  c = s.at(k);
  cout << c << endl;
  for (int i = 0; i < n; i++) {
    if (s.at(i) != c) {
      s.at(i) = '*';
    }
  }
  cout << s << endl;
  return 0;
}
