#include <bits/stdc++.h>
using namespace std;
string a;
int k;
int ispar[5000][5000];
struct node {
  node* to[2];
  int num;
  node() : num(0) {
    to[0] = 0;
    to[1] = 0;
  }
};
node* root;
void init(int i, node* s, int j) {
  if (i >= a.length()) {
    return;
  }
  if (!s->to[a[i] - 'a']) {
    s->to[a[i] - 'a'] = new node();
  }
  s->to[a[i] - 'a']->num += ispar[j][i];
  init(i + 1, s->to[a[i] - 'a'], j);
}
inline int getn(node* s) { return s ? (s->num) : 0; }
void dfs(node* s) {
  if (!s) {
    return;
  }
  dfs(s->to[0]);
  dfs(s->to[1]);
  s->num += getn(s->to[0]) + getn(s->to[1]);
}
void srch(int t, node* s) {
  if (t <= getn(s) - getn(s->to[0]) - getn(s->to[1])) {
    return;
  }
  if (t <= getn(s) - getn(s->to[1])) {
    cout << 'a';
    srch(t - getn(s) + getn(s->to[0]) + getn(s->to[1]), s->to[0]);
    return;
  }
  cout << 'b';
  srch(t - getn(s) + getn(s->to[1]), s->to[1]);
}
int main() {
  cin >> a >> k;
  for (int i = 0; i < a.length(); i++) {
    for (int j = 0; (i - j >= 0) && (i + j < a.length()); j += 2) {
      if (a[i - j] != a[i + j]) {
        break;
      }
      ispar[i - j][i + j] = 1;
    }
    for (int j = 1; (i - j >= 0) && (i + j < a.length()); j += 2) {
      if (a[i - j] != a[i + j]) {
        break;
      }
      ispar[i - j][i + j] = 1;
    }
  }
  for (int i = 0; i < a.length() - 1; i++) {
    for (int j = 0; (i - j >= 0) && (i + j + 1 < a.length()); j += 2) {
      if (a[i - j] != a[i + j + 1]) {
        break;
      }
      ispar[i - j][i + j + 1] = 1;
    }
    for (int j = 1; (i - j >= 0) && (i + j + 1 < a.length()); j += 2) {
      if (a[i - j] != a[i + j + 1]) {
        break;
      }
      ispar[i - j][i + j + 1] = 1;
    }
  }
  root = new node();
  for (int i = 0; i < a.length(); i++) {
    init(i, root, i);
  }
  dfs(root);
  srch(k, root);
  return 0;
}
