#include <bits/stdc++.h>
const int h[27] = {0,  2,  3,  5,  7,  11, 13, 17, 19, 23, 29, 31, 37, 41,
                   43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101};
const int pp = 253;
long long f1[500000], f2[500000], p[500000], s1, s2;
int a[500000], n, i, l;
char ch;
bool flag, flagt;
bool check(int i, int n) {
  if (i >= n) {
    s1 = ((f1[i] - f1[i - n] * p[n + 1] % 1000000007) * p[i - n + 1] %
              1000000007 +
          1000000007) %
         1000000007;
    s2 = ((f2[i] - f2[i - n]) % 1000000007 + 1000000007) % 1000000007;
    if (s1 == s2) return false;
  }
  return true;
}
int add(int i) {
  while (i >= 1 && a[i] == 26) a[i--] = 1;
  if (i == 0) {
    printf("Impossible");
    flag = false;
    return i;
  }
  a[i]++;
  return i;
}
int main() {
  scanf("%d\n", &n);
  scanf("%c", &ch);
  while (ch >= 'a' && ch <= 'z') {
    a[++l] = ch - 'a' + 1;
    scanf("%c", &ch);
  }
  flag = true;
  i = l;
  add(i);
  p[0] = p[1] = 1;
  for (i = 2; i <= l; i++) p[i] = (p[i - 1] * pp) % 1000000007;
  for (i = 1; i <= n - 1; i++)
    f1[i] = (f1[i - 1] * pp + h[a[i]]) % 1000000007,
    f2[i] = (f2[i - 1] + h[a[i]] * p[i]) % 1000000007;
  i = n;
  flagt = false;
  while (i <= l) {
    f1[i] = (f1[i - 1] * pp + h[a[i]]) % 1000000007,
    f2[i] = (f2[i - 1] + h[a[i]] * p[i]) % 1000000007;
    if (check(i, n) && check(i, n + 1)) {
      i++;
      if (flagt && i <= l) a[i] = 1;
    } else
      i = add(i), flagt = true;
    if (!flag) return 0;
  }
  for (i = 1; i <= l; i++) printf("%c", a[i] + 96);
  return 0;
}
