#include <bits/stdc++.h>
using namespace std;
int step1[400010], step2[400010], rev1[400010], rev2[400010];
void init() {
  step1[0] = step2[0] = rev1[0] = rev2[0] = 1;
  for (int i = 1; i < 400010; ++i)
    step1[i] = (29LL * step1[i - 1]) % 1000000007LL,
    step2[i] = (29LL * step2[i - 1]) % 1000000087LL,
    rev1[i] = (rev1[i - 1] * 758620695LL) % 1000000007LL,
    rev2[i] = (rev2[i - 1] * 275862093LL) % 1000000087LL;
}
int len;
char pr[400010], obr[400010];
int pcode1[400010], pcode2[400010], ocode1[400010], ocode2[400010];
long long get_code(int* on, int f, int t, long long mod, long long oem) {
  long long c1 = 0;
  for (int i = t; i > 0; i -= (i & (-i))) c1 = (c1 + on[i]);
  for (int i = f - 1; i > 0; i -= (i & (-i))) c1 = (c1 - on[i]);
  c1 %= mod;
  return ((c1 + mod) * oem) % mod;
}
inline long long encode(int* p1, int* p2, int f, int t) {
  return (get_code(p1, f, t, 1000000007LL, rev1[f - 1]) << 32) +
         get_code(p2, f, t, 1000000087LL, rev2[f - 1]);
}
void init_hash() {
  for (int i = 1; i <= len; ++i) {
    long long val1 = ((step1[i] * ((long long)pr[i] - 'a' + 1)) % 1000000007LL +
                      1000000007LL) %
                     1000000007LL,
              val2 = ((step2[i] * ((long long)pr[i] - 'a' + 1)) % 1000000087LL +
                      1000000087LL) %
                     1000000087LL;
    for (int j = i; j < 400010; j += (j & (-j))) {
      pcode1[j] += val1;
      if (pcode1[j] >= 1000000007LL) pcode1[j] -= 1000000007LL;
      pcode2[j] += val2;
      if (pcode2[j] >= 1000000087LL) pcode2[j] -= 1000000087LL;
    }
  }
  for (int i = 1; i <= len; ++i) {
    long long val1 =
                  ((step1[i] * ((long long)obr[i] - 'a' + 1)) % 1000000007LL +
                   1000000007LL) %
                  1000000007LL,
              val2 =
                  ((step2[i] * ((long long)obr[i] - 'a' + 1)) % 1000000087LL +
                   1000000087LL) %
                  1000000087LL;
    for (int j = i; j < 400010; j += (j & (-j))) {
      ocode1[j] += val1;
      if (ocode1[j] >= 1000000007LL) ocode1[j] -= 1000000007LL;
      ocode2[j] += val2;
      if (ocode2[j] >= 1000000087LL) ocode2[j] -= 1000000087LL;
    }
  }
}
void set_pr(int pos, char to) {
  long long add1 =
      ((1000000007LL + ((long long)to - pr[pos]) * step1[pos]) % 1000000007LL +
       1000000007LL) %
      1000000007LL;
  long long add2 =
      ((1000000087LL + ((long long)to - pr[pos]) * step2[pos]) % 1000000087LL +
       1000000087LL) %
      1000000087LL;
  for (int i = pos; i < 400010; i += (i & (-i))) {
    pcode1[i] += add1, pcode2[i] += add2;
    if (pcode1[i] >= 1000000007LL) pcode1[i] -= 1000000007LL;
    if (pcode2[i] >= 1000000087LL) pcode2[i] -= 1000000087LL;
  }
  pr[pos] = to;
}
void set_obr(int pos, char to) {
  long long add1 =
      ((1000000007LL + ((long long)to - obr[pos]) * step1[pos]) % 1000000007LL +
       1000000007LL) %
      1000000007LL;
  long long add2 =
      ((1000000087LL + ((long long)to - obr[pos]) * step2[pos]) % 1000000087LL +
       1000000087LL) %
      1000000087LL;
  for (int i = pos; i < 400010; i += (i & (-i))) {
    ocode1[i] += add1, ocode2[i] += add2;
    if (ocode1[i] >= 1000000007LL) ocode1[i] -= 1000000007LL;
    if (ocode2[i] >= 1000000087LL) ocode2[i] -= 1000000087LL;
  }
  obr[pos] = to;
}
int D;
bool check(int pos) {
  int lo = pos - D + 1;
  if (lo)
    if (encode(pcode1, pcode2, lo, pos) ==
        encode(ocode1, ocode2, len - pos + 1, len - lo + 1))
      return false;
  --lo;
  if (lo)
    if (encode(pcode1, pcode2, lo, pos) ==
        encode(ocode1, ocode2, len - pos + 1, len - lo + 1))
      return false;
  return true;
}
int main() {
  init();
  scanf("%d", &D);
  scanf("%s", pr + 1);
  len = strlen(pr + 1);
  memcpy(obr, pr, sizeof pr);
  reverse(obr + 1, obr + len + 1);
  init_hash();
  int mod;
  for (mod = 1; mod < len; ++mod)
    if (!check(mod)) break;
  bool SOL = true;
  for (;;) {
    if (pr[mod] == 'z') {
      --mod;
      if (!mod) {
        SOL = false;
        break;
      }
    } else {
      set_pr(mod, pr[mod] + 1);
      set_obr(len - mod + 1, obr[len - mod + 1] + 1);
      if (check(mod)) break;
    }
  }
  if (!SOL)
    printf("Impossible\n");
  else {
    for (int i = mod + 1; i <= len; ++i) {
      for (char to = 'a';; ++to) {
        set_pr(i, to);
        set_obr(len - i + 1, to);
        if (check(i)) break;
      }
    }
    printf("%s\n", pr + 1);
  }
  return 0;
}
