#include <bits/stdc++.h>
char ch[401000], s[401000];
int n, m;
int a[401000], b[401000], p[401000];
bool flag;
bool can(int x, int y) {
  x++;
  if (x < y) return 1;
  int ax = a[x] - a[x - y] * p[y];
  int bx = b[x] - b[x - y];
  return (p[x - y] * ax != bx);
}
void dfs(int x, bool y) {
  if (x == n) {
    s[n] = '\0';
    flag = 1;
    puts(s);
    return;
  }
  for (s[x] = (y ? ch[x] : 'a'); s[x] <= 'z'; s[x]++) {
    a[x + 1] = a[x] * 1000000007 + s[x];
    b[x + 1] = b[x] + p[x] * s[x];
    if (can(x, m) && can(x, m + 1)) dfs(x + 1, (y && s[x] == ch[x]));
    if (flag) return;
  }
}
int main() {
  int i, j;
  scanf("%d", &m);
  scanf("%s", ch);
  n = strlen(ch);
  for (i = n - 1; i >= 0 && ch[i] == 'z'; i--) ch[i] = 'a';
  if (i < 0) {
    puts("Impossible");
    return 0;
  }
  ch[i]++;
  flag = 0;
  p[0] = 1;
  for (i = 1; i <= n; i++) p[i] = p[i - 1] * 1000000007;
  dfs(0, 1);
  if (!flag) {
    puts("Impossible");
  }
}
