#include <bits/stdc++.h>
template <class T>
inline void chkmax(T &x, const T &y) {
  if (x < y) x = y;
}
template <class T>
inline void chkmin(T &x, const T &y) {
  if (x > y) x = y;
}
template <class T>
inline void read(T &x) {
  char c;
  int f = 1;
  x = 0;
  while (((c = getchar()) < '0' || c > '9') && c != '-')
    ;
  if (c == '-')
    f = -1;
  else
    x = c - '0';
  while ((c = getchar()) >= '0' && c <= '9') x = x * 10 + c - '0';
  x *= f;
}
static int outn;
static char out[(int)2e7];
template <class T>
inline void write(T x) {
  if (x < 0) out[outn++] = '-', x = -x;
  if (x) {
    static int tmpn;
    static char tmp[20];
    tmpn = 0;
    while (x) tmp[tmpn++] = x % 10 + '0', x /= 10;
    while (tmpn) out[outn++] = tmp[--tmpn];
  } else
    out[outn++] = '0';
}
const int N = 4e5;
const int BASE = 131, INV = 922042494, MOD = 998244353;
int d, n;
char s[N + 9];
char a[N + 9];
int pw[N + 9];
int ip[N + 9];
int f[N + 9];
int g[N + 9];
int getf(int l, int len) {
  return (f[l + len - 1] - (long long)f[l - 1] * pw[len] % MOD + MOD) % MOD;
}
int getg(int l, int len) {
  return (long long)(g[l + len - 1] - g[l - 1] + MOD) * ip[l - 1] % MOD;
}
bool check(int p) {
  if (p >= d && getf(p - d + 1, d >> 1) == getg(p - (d >> 1) + 1, d >> 1))
    return true;
  if (p >= d + 1 &&
      getf(p - d, (d + 1) >> 1) == getg(p - ((d + 1) >> 1) + 1, (d + 1) >> 1))
    return true;
  return false;
}
void dfs(int x, bool t) {
  if (x == n + 1) {
    if (!t) return;
    puts(a + 1);
    exit(0);
  }
  for (char i = t ? 'a' : s[x]; i <= 'z'; ++i) {
    a[x] = i;
    f[x] = ((long long)f[x - 1] * BASE + i) % MOD;
    g[x] = (g[x - 1] + (long long)pw[x - 1] * i % MOD) % MOD;
    if (!check(x)) dfs(x + 1, t ? true : i > s[x]);
  }
}
int main() {
  read(d);
  scanf("%s", s + 1);
  n = strlen(s + 1);
  pw[0] = ip[0] = 1;
  for (int i = 1; i <= n; ++i) {
    pw[i] = (long long)pw[i - 1] * BASE % MOD;
    ip[i] = (long long)ip[i - 1] * INV % MOD;
  }
  dfs(1, 0);
  puts("Impossible");
  return 0;
}
