#include <bits/stdc++.h>
long long p, n, h[500000], r[5000000], e[500000];
char s[500000];
inline bool ispalind(long long a, long long b) {
  return (h[b] - h[a - 1] * e[b - a + 1]) * e[a - 1] == r[b] - r[a - 1];
}
const long long fac = 129581259982959;
signed main() {
  scanf("%lld%s", &p, s + 1);
  n = strlen(s + 1);
  e[0] = 1;
  for (long long i = 1; i <= n; i++) e[i] = fac * e[i - 1];
  h[0] = r[0] = 1;
  long long cur = n;
  for (long long i = 1; i <= n; i++) {
    h[i] = h[i - 1] * fac + s[i];
    r[i] = r[i - 1] + e[i - 1] * s[i];
    if ((i >= p && ispalind(i - p + 1, i)) || (i > p && ispalind(i - p, i))) {
      cur = i;
      break;
    }
  }
  bool ok = false;
  for (long long i = cur; i > 0; i--) {
    for (char c = s[i] + 1; c <= 'z'; c++) {
      s[i] = c;
      h[i] = h[i - 1] * fac + s[i];
      r[i] = r[i - 1] + e[i - 1] * s[i];
      if ((i >= p && ispalind(i - p + 1, i)) || (i > p && ispalind(i - p, i)))
        continue;
      ok = true;
      break;
    }
    if (ok) {
      cur = i;
      break;
    }
  }
  if (!ok) {
    puts("Impossible");
    return 0;
  }
  for (long long i = cur + 1; i <= n; i++)
    for (char c = 'a'; c <= 'z'; c++) {
      s[i] = c;
      h[i] = h[i - 1] * fac + s[i];
      r[i] = r[i - 1] + e[i - 1] * s[i];
      if ((i >= p && ispalind(i - p + 1, i)) || (i > p && ispalind(i - p, i)))
        continue;
      break;
    }
  puts(s + 1);
  return 0;
}
