#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
long long qpow(long long x, long long k) {
  return k == 0 ? 1
                : 1ll * qpow(1ll * x * x % mod, k >> 1) * (k & 1 ? x : 1) % mod;
}
const int Maxn = 4e5 + 5;
const long long md = 122420729;
const long long A = md * md;
const int h = 31;
const int base = 'a' - 1;
int d, n;
char s[Maxn];
long long pre[Maxn], suf[Maxn];
long long pw[Maxn];
long long getPre(int l, int r) {
  long long ret =
      ((pre[r] - pre[l - 1] * pw[r - l + 1] + A) % md) * pw[l - 1] % md;
  return ret;
}
long long getSuf(int l, int r) {
  long long ret = (suf[r] - suf[l - 1] + md) % md;
  return ret;
}
bool check(int l, int r) { return getPre(l, r) == getSuf(l, r); }
int main() {
  scanf("%d%s", &d, s + 1);
  n = strlen(s + 1);
  pw[0] = 1;
  for (int i = 1; i <= n; i++) {
    pre[i] = (pre[i - 1] * h + s[i] - base) % md;
    pw[i] = pw[i - 1] * h % md;
  }
  for (int i = 1; i <= n; i++) {
    suf[i] = (suf[i - 1] + pw[i - 1] * (s[i] - base)) % md;
  }
  int bp = n;
  for (int i = 1; i <= n; i++) {
    if (i >= d) {
      if (check(i - d + 1, i)) {
        bp = i;
        break;
      }
    }
    if (i > d) {
      if (check(i - d, i)) {
        bp = i;
        break;
      }
    }
  }
  while (bp >= 1) {
    bool cont = true;
    while (s[bp] < 'z') {
      s[bp]++;
      pre[bp] = (pre[bp - 1] * h + s[bp] - base) % md;
      suf[bp] = (suf[bp - 1] + pw[bp - 1] * (s[bp] - base)) % md;
      if (bp >= d) {
        if (check(bp - d + 1, bp)) {
          continue;
        }
      }
      if (bp > d) {
        if (check(bp - d, bp)) {
          continue;
        }
      }
      cont = false;
      break;
    }
    if (cont)
      bp--;
    else
      break;
  }
  if (bp == 0) {
    printf("Impossible\n");
    return 0;
  }
  while (bp < n) {
    bp++;
    s[bp] = 'a' - 1;
    bool ok = false;
    while (s[bp] < 'z') {
      s[bp]++;
      pre[bp] = (pre[bp - 1] * h + s[bp] - base) % md;
      suf[bp] = (suf[bp - 1] + pw[bp - 1] * (s[bp] - base)) % md;
      if (bp >= d) {
        if (check(bp - d + 1, bp)) {
          continue;
        }
      }
      if (bp > d) {
        if (check(bp - d, bp)) {
          continue;
        }
      }
      ok = true;
      break;
    }
    if (!ok) {
      printf("Impossible\n");
      return 0;
    }
  }
  printf("%s", s + 1);
  return 0;
}
