#include <bits/stdc++.h>
using namespace std;
int d, n;
bool flag = true, update = false;
char s[400005];
long long p[400005], a1[400005], a2[400005];
void init() {
  scanf("%d\n", &d);
  gets(s);
}
bool pd(int x, int len) {
  long long a, b;
  if (x < len - 1) return true;
  a = a1[x];
  a -= a1[x - len / 2] * p[len / 2];
  b = a2[x - (len + 1) / 2];
  if (x != len - 1) b -= a2[x - len];
  return a * p[x - len + 1] != b;
}
bool dfs(int i, bool flag) {
  bool t;
  bool flag1, flag2;
  char ch, pre;
  if (i == n) return true;
  if (flag) {
    pre = s[i];
    for (ch = s[i]; ch <= 'z'; ch++) {
      s[i] = ch;
      if (!i)
        a1[i] = s[i] - 'a' + 1;
      else
        a1[i] = a1[i - 1] * 3214567 + s[i] - 'a' + 1;
      if (!i)
        a2[i] = s[i] - 'a' + 1;
      else
        a2[i] = a2[i - 1] + (s[i] - 'a' + 1) * p[i];
      flag1 = pd(i, d);
      flag2 = pd(i, d + 1);
      if (flag1 && flag2 && dfs(i + 1, ch == pre)) return true;
    }
  } else
    for (ch = 'a'; ch <= 'z'; ch++) {
      s[i] = ch;
      if (!i)
        a1[i] = s[i] - 'a' + 1;
      else
        a1[i] = a1[i - 1] * 3214567 + s[i] - 'a' + 1;
      if (!i)
        a2[i] = s[i] - 'a' + 1;
      else
        a2[i] = a2[i - 1] + (s[i] - 'a' + 1) * p[i];
      flag1 = pd(i, d);
      flag2 = pd(i, d + 1);
      if (flag1 && flag2 && dfs(i + 1, false)) return true;
    }
  return false;
}
void work() {
  int i, j, k;
  if (d == 1) {
    puts("Impossible");
    return;
  }
  n = strlen(s);
  p[0] = 1;
  for (i = 1; i < n; i++) p[i] = p[i - 1] * 3214567;
  for (i = n - 1; i >= 0; i--)
    if (s[i] == 'z')
      s[i] = 'a';
    else
      break;
  if (i == -1) {
    puts("Impossible");
    return;
  }
  s[i]++;
  if (!dfs(0, true))
    puts("Impossible");
  else
    puts(s);
}
int main() {
  init();
  work();
  return 0;
}
