#include <bits/stdc++.h>
using namespace std;
char s[500010], ans[500010];
long long bas[500010], pre[500010], suf[500010];
int n, m;
inline bool Pd(int x, int d) {
  if (x < d) return (1);
  int l0 = x - d + 1, r0 = l0 + (d / 2) - 1;
  int r1 = x, l1 = r1 - (d / 2) + 1;
  long long s0 = (pre[r0] - pre[l0 - 1] + 1000000007) % 1000000007,
            s1 = (suf[r1] - suf[l1 - 1] + 1000000007) % 1000000007;
  if (l0 - 1 > n - r1)
    s1 = s1 * bas[l0 - 1 - (n - r1)] % 1000000007;
  else
    s0 = s0 * bas[n - r1 - (l0 - 1)] % 1000000007;
  return (s0 != s1);
}
inline void Dfs(int x, bool p) {
  if (x > n) {
    printf("%s\n", ans + 1);
    exit(0);
  }
  for (int i = (p) ? (0) : (s[x] - 'a'); i < 26; i++) {
    ans[x] = i + 'a';
    pre[x] = (pre[x - 1] + i * bas[x] % 1000000007) % 1000000007;
    suf[x] = (suf[x - 1] + i * bas[n - x + 1] % 1000000007) % 1000000007;
    if (Pd(x, m) && Pd(x, m + 1)) Dfs(x + 1, p | (i > s[x] - 'a'));
  }
}
int main() {
  scanf("%d%s", &m, s + 1);
  n = strlen(s + 1);
  int lst = n;
  while (lst && s[lst] == 'z') s[lst] = 'a', lst--;
  if (!lst) {
    puts("Impossible");
    return (0);
  }
  s[lst]++;
  bas[0] = 1;
  for (int i = 1; i <= n; i++) bas[i] = bas[i - 1] * 700009 % 1000000007;
  Dfs(1, 0);
  puts("Impossible");
}
