#include <bits/stdc++.h>
using namespace std;
const int MAXN = 400005, B = 131;
char s[MAXN], ans[MAXN];
int i, j, k, N, D, ha[MAXN], hb[MAXN], p[MAXN];
void init() {
  scanf("%d\n%s", &D, s), ans[N = strlen(s)] = 0;
  for (i = p[0] = 1; i <= N; i++) p[i] = p[i - 1] * B;
}
inline bool Hash(int x, int m) {
  return ++x < m ? 1
                 : (ha[x] - ha[x - m] * p[m]) * p[x - m] != hb[x] - hb[x - m];
}
inline bool DFS(int x, bool y) {
  if (x >= N) return puts(ans), 1;
  for (ans[x] = (y ? s[x] : 'a'); ans[x] <= 'z'; ans[x]++) {
    ha[x + 1] = ha[x] * B + ans[x] - 'a' + 1,
           hb[x + 1] = hb[x] + (ans[x] - 'a' + 1) * p[x];
    if (Hash(x, D) && Hash(x, D + 1))
      if (DFS(x + 1, y && (ans[x] == s[x]))) return 1;
  }
  return 0;
}
void work() {
  for (i = N - 1; i >= 0 && s[i] == 'z'; s[i--] = 'a')
    ;
  if (i < 0) {
    puts("Impossible");
    return;
  }
  s[i]++;
  if (!DFS(0, 1)) puts("Impossible");
}
int main() {
  init();
  work();
  return 0;
}
