#include <bits/stdc++.h>
using namespace std;
const unsigned long long mod = 29;
unsigned long long cf[400100], a[400100];
int n, m;
char s[400100];
inline void ex() {
  puts("Impossible");
  exit(0);
}
unsigned long long h[400100];
inline void dfs(int p, int f, unsigned long long h1, unsigned long long h2) {
  if (p == n + 1) {
    for (register int i = 1; i <= n; i++) printf("%c", a[i] + 'a' - 1);
    exit(0);
  }
  if (f == 0)
    a[p] = 1;
  else
    a[p] = s[p] - 'a' + 1;
  unsigned long long nh1, nh2;
  while (a[p] <= 26) {
    if (p > m)
      nh1 = (h1 - a[p - m] * cf[m - 1]) * mod + a[p];
    else
      nh1 = h1 * mod + a[p];
    nh2 = h2 + cf[p - 1] * a[p];
    h[p] = nh2;
    if ((p < m || nh1 * cf[p - m] != h[p] - h[p - m]) &&
        (p < m + 1 || (a[p - m] * cf[m - 1] * mod + nh1) * cf[p - m - 1] !=
                          h[p] - h[p - m - 1]))
      dfs(p + 1, a[p] + 'a' - 1 == s[p] && f, nh1, nh2);
    a[p]++;
  }
}
int main() {
  scanf("%d%s", &m, s + 1);
  n = strlen(s + 1);
  s[n]++;
  for (int i = n; i; i--) {
    if (s[i] > 'z')
      s[i] = 'a', s[i - 1]++;
    else
      break;
  }
  if (s[0]) ex();
  cf[0] = 1;
  for (int i = 1; i <= n; i++) cf[i] = cf[i - 1] * mod;
  dfs(1, 1, 0, 0);
  ex();
  return 0;
}
