#include <bits/stdc++.h>
using namespace std;
int n, d;
char s[820005], Ans[820005];
long long F[820005], G[820005], P[820005];
const long long p1 = 237;
bool Judge(int p, int d) {
  if (p < d) return 0;
  int h1 = (F[p] - F[p - d] * P[d]) % 10000007 * P[p - d] % 10000007;
  int h2 = (G[p] - G[p - d]) % 10000007;
  if (h1 < 0) h1 += 10000007;
  if (h2 < 0) h2 += 10000007;
  return h1 == h2;
}
void dfs(int p, int f) {
  if (p > n) {
    if (!f) return;
    for (int i = 1; i <= n; i++) printf("%c", Ans[i]);
    printf("\n");
    exit(0);
  }
  for (int i = f ? 'a' : s[p]; i <= 'z'; i++) {
    Ans[p] = i;
    F[p] = (F[p - 1] * p1 + i) % 10000007;
    G[p] = (G[p - 1] + P[p - 1] * i) % 10000007;
    if (Judge(p, d) || Judge(p, d + 1)) continue;
    dfs(p + 1, f | (i > s[p]));
  }
}
int main() {
  scanf("%d", &d);
  scanf("%s", s + 1);
  n = strlen(s + 1);
  P[0] = 1;
  for (int i = 1; i <= n; i++) P[i] = P[i - 1] * p1 % 10000007;
  dfs(1, 0);
  printf("Impossible\n");
}
