#include <bits/stdc++.h>
using namespace std;
template <class T, class L>
bool smax(T &x, L y) {
  return x < y ? (x = y, 1) : 0;
}
template <class T, class L>
bool smin(T &x, L y) {
  return y < x ? (x = y, 1) : 0;
}
const int maxn = 4e5 + 17, base = maxn + 17, mod = 1e9 + 17, z = 26;
int n, d, po[maxn];
struct node {
  int l, x;
  node(int _l = 0, int _x = 0) { l = _l, x = _x; }
  node operator&(const node &o) {
    return {l + o.l, int(((long long)x * po[o.l] + o.x) % mod)};
  }
  bool operator==(const node &o) { return x == o.x; }
};
const node zero;
char s[maxn];
struct seg_hash {
  node iman[maxn << 1];
  void majid() {
    for (int i = maxn; i < maxn << 1; i++) iman[i] = node(1, s[i - maxn]);
    for (int i = maxn - 1; i; i--) iman[i] = iman[i << 1] & iman[i << 1 | 1];
  }
  node hamid(int l, int r) {
    node L, R;
    for (l += maxn, r += maxn; l < r; l >>= 1, r >>= 1) {
      if (l & 1) L = L & iman[l++];
      if (r & 1) R = iman[--r] & R;
    }
    return L & R;
  }
  void arpa(int p, char c) {
    for (iman[p += maxn].x = c; p >>= 1;)
      iman[p] = iman[p << 1] & iman[p << 1 | 1];
  }
} str, rev;
void make_amirjoon_happy() {
  *po = 1;
  for (int i = 1; i < maxn; i++) po[i] = (long long)po[i - 1] * base % mod;
  str.majid();
  reverse(s, s + n);
  rev.majid();
  reverse(s, s + n);
}
int destruct(int idx) {
  while (idx >= 0 && s[idx] == 'z') idx--;
  if (idx == -1) {
    cout << "Impossible\n";
    exit(0);
  }
  char t = s[idx] + 1;
  str.arpa(idx, t);
  rev.arpa(n - idx - 1, t);
  s[idx]++;
  return idx;
}
int main() {
  scanf("%d\n%s", &d, s);
  n = strlen(s);
  make_amirjoon_happy();
  int one = n;
  for (int i = d - 1; i < n;) {
    if (one < i) str.arpa(i, 'a'), rev.arpa(n - i - 1, 'a'), s[i] = 'a';
    if (i - d + 1 >= 0 && str.hamid(i - d + 1, i + 1) ==
                              rev.hamid(n - i - 1, n - i + d - 1) ||
        i - d >= 0 &&
            str.hamid(i - d, i + 1) == rev.hamid(n - i - 1, n - i + d) ||
        i == n - 1 && one == n)
      one = i = destruct(i);
    else
      i++;
  }
  puts(s);
  return 0;
}
