#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  double n;
  int sum = 0;
  cin >> s >> n >> sum;
  for (int i = 0; i < s[n - 1]; i++) {
    sum += i;
    if (s[sum / n] - sum / n < sum / n - s[sum / n + 1]) {
      cout << sum / n << endl;
    }
    if (s[sum / n] - sum / n == sum / n == s[sum / n + 1]) {
      cout << s[sum / n] << endl;
    } else
      cout << '0' << endl;
  }
  cout << endl;
}
