#include <bits/stdc++.h>
using namespace std;
const int P = 1000009;
const int maxn = 1000001;
long long n, m;
long long L[maxn], R[maxn], Q[maxn];
char st[maxn], sz[maxn];
long long huiwen(long long x, long long y) {
  if (x < y) return 0;
  return (L[x] - L[x - y] * Q[y]) * Q[x - y] == R[x] - R[x - y];
}
long long find(long long x, long long top) {
  if (x == n + 1) return true;
  for (long long i = top ? st[x] : 'a'; i <= 'z'; ++i) {
    sz[x] = i;
    L[x] = L[x - 1] * P + i;
    R[x] = R[x - 1] + i * Q[x - 1];
    if (!huiwen(x, m) && !huiwen(x, m + 1) && find(x + 1, top && (i == st[x])))
      return true;
  }
  return false;
}
int main() {
  long long i;
  scanf("%I64d\n", &m);
  scanf("%s", st + 1);
  for (n = 0; st[n + 1]; ++n)
    ;
  for (Q[0] = 1, i = 1; i <= n; ++i) Q[i] = Q[i - 1] * P;
  for (i = n; i && st[i] == 'z'; --i) st[i] = 'a';
  st[i]++;
  if (!i || !find(1, 1))
    printf("Impossible\n");
  else
    for (i = 1; i <= n; ++i) printf("%c", sz[i]);
  return 0;
}
