#include <bits/stdc++.h>
using namespace std;
unsigned long long pw[1020304], iv[1020304];
unsigned long long h[1020304], f[1020304];
int check(int l, int r) {
  unsigned long long p1 = (h[r] + 1000000007 -
                           h[l - 1] * pw[r - l + 1] % 1000000007) %
                          1000000007,
                     p2 = (f[r] + 1000000007 - f[l - 1]) * iv[l - 1] %
                          1000000007;
  return p1 == p2;
}
int n, d;
char s[1020304];
bool dfs(int i, bool w) {
  if (i == 4) {
    int z = i;
  }
  if (i > n && w) cout << s + 1 << endl;
  if (i > n) return w;
  char t = s[i];
  for (char c = (w) ? 'a' : s[i]; c <= 'z'; c++) {
    if (i >= d)
      if (check(i - d + 2, i - 1) && s[i - d + 1] == c) continue;
    if (i > d)
      if (check(i - d + 1, i - 1) && s[i - d] == c) continue;
    h[i] = (h[i - 1] * 10007 + c) % 1000000007;
    f[i] = (f[i - 1] + pw[i - 1] * c) % 1000000007;
    s[i] = c;
    if (dfs(i + 1, c > t || w)) return true;
  }
  s[i] = t;
  return false;
}
int main() {
  unsigned long long t = 1;
  pw[0] = iv[0] = 1;
  for (int i = 1; i <= 400000; ++i)
    pw[i] = pw[i - 1] * 10007 % 1000000007,
    iv[i] = iv[i - 1] * 820925358 % 1000000007;
  cin >> d;
  scanf("%s", s + 1);
  n = strlen(s + 1);
  if (d == 1) {
    puts("Impossible");
    return 0;
  }
  if (!dfs(1, 0)) {
    puts("Impossible");
    return 0;
  }
  return 0;
}
