#include <bits/stdc++.h>
using namespace std;
int main() {
  int a;
  cin >> a;
  char c[a];
  int b;
  cin >> b;
  char s = c[b - 1];
  for (int i = 0; i < a; i++) {
    if (c[i] != s) {
      c[i] = s;
      cout << c[i];
    } else
      cout << c[i];
  }
}
