#include <bits/stdc++.h>
char s[400002];
int d, pw[400001];
unsigned int hs[400001], rhs[400002];
int geths(int s, int e) { return hs[e] - hs[s - 1] * pw[e - s + 1]; }
int getrhs(int s, int e) { return rhs[e] - rhs[s - 1]; }
bool ispal(int pos) {
  if (pos >= d &&
      geths(pos - d + 1, pos) * pw[pos - d + 1] == getrhs(pos - d + 1, pos))
    return true;
  if (pos >= d + 1 && geths(pos - d, pos) * pw[pos - d] == getrhs(pos - d, pos))
    return true;
  return false;
}
int main() {
  scanf("%d%s", &d, s + 1);
  int n = strlen(s + 1);
  pw[0] = 1;
  for (int i = 1; i <= n; ++i) pw[i] = pw[i - 1] * 185539;
  for (int i = 1; i <= n; ++i) {
    hs[i] = hs[i - 1] * 185539 + s[i];
    rhs[i] = rhs[i - 1] + pw[i] * s[i];
  }
  int badpos = n;
  for (int i = 1; badpos == n && i < n; ++i)
    if (ispal(i)) badpos = i;
  while (badpos) {
    bool f = false;
    for (char j = s[badpos] + 1; !f && j <= 'z'; ++j) {
      s[badpos] = j;
      hs[badpos] = hs[badpos - 1] * 185539 + j;
      rhs[badpos] = rhs[badpos - 1] + pw[badpos] * j;
      if (!ispal(badpos)) f = true;
    }
    if (f) break;
    --badpos;
  }
  if (!badpos) {
    printf("Impossible");
    return 0;
  }
  for (int i = badpos + 1; i <= n; ++i)
    for (s[i] = 'a';; ++s[i]) {
      hs[i] = hs[i - 1] * 185539 + s[i];
      rhs[i] = rhs[i - 1] + pw[i] * s[i];
      if (!ispal(i)) break;
    }
  printf("%s", s + 1);
  return 0;
}
