#include <bits/stdc++.h>
using namespace std;
const int P = 1523527;
const int N = 400007;
int n, d;
char st[N];
long long pp[N], H[N], R[N], TH[4 * N], TR[4 * N];
bool isPolyLinear(int l, int r) {
  long long h1 = (H[r] - H[l - 1]) * pp[n - l];
  long long h2 = (R[l] - R[r + 1]) * pp[n - (n - r + 1)];
  return h1 == h2;
}
void build(int v, int tl, int tr) {
  if (tl == tr) {
    TH[v] = st[tl] * pp[1];
    TR[v] = TH[v];
    return;
  }
  int tm = (tl + tr) >> 1;
  build(2 * v, tl, tm);
  build(2 * v + 1, tm + 1, tr);
  TH[v] = TH[2 * v] + pp[tm - tl + 1] * TH[2 * v + 1];
  TR[v] = TR[2 * v + 1] + pp[tr - tm] * TR[2 * v];
}
void update(int v, int tl, int tr, int pos) {
  if (tl == tr) {
    TH[v] = st[tl] * pp[1];
    TR[v] = TH[v];
    return;
  }
  int tm = (tl + tr) >> 1;
  if (pos <= tm)
    update(2 * v, tl, tm, pos);
  else
    update(2 * v + 1, tm + 1, tr, pos);
  TH[v] = TH[2 * v] + pp[tm - tl + 1] * TH[2 * v + 1];
  TR[v] = TR[2 * v + 1] + pp[tr - tm] * TR[2 * v];
}
long long getH(int v, int tl, int tr, int l, int r) {
  if (tl == l && tr == r) return TH[v];
  int tm = (tl + tr) >> 1;
  if (r <= tm) return getH(2 * v, tl, tm, l, r);
  if (l > tm) return getH(2 * v + 1, tm + 1, tr, l, r);
  return getH(2 * v, tl, tm, l, tm) +
         getH(2 * v + 1, tm + 1, tr, tm + 1, r) * pp[tm - l + 1];
}
long long getR(int v, int tl, int tr, int l, int r) {
  if (tl == l && tr == r) return TR[v];
  int tm = (tl + tr) >> 1;
  if (r <= tm) return getR(2 * v, tl, tm, l, r);
  if (l > tm) return getR(2 * v + 1, tm + 1, tr, l, r);
  return getR(2 * v + 1, tm + 1, tr, tm + 1, r) +
         getR(2 * v, tl, tm, l, tm) * pp[r - tm];
}
bool isPoly(int l, int r) {
  long long h1 = getH(1, 1, n, l, r);
  long long h2 = getR(1, 1, n, l, r);
  return h1 == h2;
}
bool dfs(int pos) {
  if (pos > n) return true;
  char ch = st[pos];
  for (char c = 'a'; c <= 'z'; ++c) {
    st[pos] = c;
    update(1, 1, n, pos);
    bool f = false;
    if (pos - d + 1 >= 1 && isPoly(pos - d + 1, pos)) f = true;
    if (!f && pos - d >= 1 && isPoly(pos - d, pos)) f = true;
    if (!f && dfs(pos + 1)) return true;
  }
  st[pos] = ch;
  update(1, 1, n, pos);
  return false;
}
int main() {
  scanf("%d%s", &d, st + 1);
  n = strlen(st + 1);
  pp[0] = 1;
  for (int i = 1; i < N; ++i) pp[i] = P * pp[i - 1];
  for (int i = 1; i <= n; ++i) H[i] = pp[i] * st[i] + H[i - 1];
  for (int i = n; i >= 1; --i) R[i] = pp[n - i + 1] * st[i] + R[i + 1];
  int pos = 0;
  for (int i = 1; i < n && !pos; ++i) {
    if (i - d + 1 >= 1 && isPolyLinear(i - d + 1, i)) pos = i;
    if (i - d >= 1 && isPolyLinear(i - d, i)) pos = i;
  }
  build(1, 1, n);
  if (pos == 0)
    pos = n - 1;
  else
    --pos;
  for (int i = pos; i >= 0; --i) {
    char ch = st[i + 1];
    char &nxt = st[i + 1];
    bool ok = false;
    while (nxt != 'z') {
      ++nxt;
      update(1, 1, n, i + 1);
      bool f = false;
      if (i + 1 - d + 1 >= 1 && isPoly(i + 1 - d + 1, i + 1)) f = true;
      if (!f && i + 1 - d >= 1 && isPoly(i + 1 - d, i + 1)) f = true;
      if (!f) {
        ok = true;
        break;
      }
    }
    if (!ok) {
      nxt = ch;
      update(1, 1, n, i + 1);
      continue;
    }
    dfs(i + 2);
    printf("%s\n", st + 1);
    return 0;
  }
  puts("Impossible");
  return 0;
}
