#include <bits/stdc++.h>
using namespace std;
int po[401000], rev, d;
char s[401000];
int h[401000], rh[401000][2];
int has(int l, int len) {
  int res;
  res = (h[l + len] - (long long)h[l] * po[len] % 1000000007) % 1000000007;
  if (res < 0) res += 1000000007;
  return res;
}
int Pow(int t, int k) {
  if (k == 0) return 1;
  int w = Pow(t, k / 2);
  w = (long long)w * w % 1000000007;
  if (k & 1) w = (long long)w * t % 1000000007;
  return w;
}
void insert(int i) {
  for (int j = 0; j < 2; j++) {
    int len = (d + j) / 2;
    int tmp = rh[i][j];
    if (i >= len) {
      tmp = (tmp - (s[i - len] - 'a' + 1)) % 1000000007;
      if (tmp < 0) tmp += 1000000007;
    }
    rh[i + 1][j] = ((long long)tmp * rev % 1000000007 +
                    (long long)(s[i] - 'a' + 1) * po[len - 1] % 1000000007) %
                   1000000007;
  }
  return;
}
bool comp(int st, int delta) {
  if (st < 0) return 0;
  int r = (d + delta) / 2;
  return rh[st + r][delta] == has(st + r + (d + delta) % 2, r);
}
int check(int i) {
  h[i + 1] = ((long long)h[i] * 129 + s[i] - 'a' + 1) % 1000000007;
  return !comp(i - d + 1, 0) && !comp(i - d, 1);
}
bool plusone(int e, int& res) {
  while (e > -1) {
    if (s[e] == 'z') {
      s[e] = 'a';
    } else {
      res = e;
      s[e]++;
      return true;
    }
    e--;
  }
  res = e;
  return e > -1;
}
int main() {
  int len, tmp;
  rev = Pow(129, 1000000007 - 2);
  po[0] = 1;
  for (int i = 1; i < 401000; i++)
    po[i] = (long long)po[i - 1] * 129 % 1000000007;
  scanf("%d%s", &d, s);
  len = strlen(s);
  if (!plusone(len - 1, tmp)) {
    puts("Impossible");
    return 0;
  }
  bool ok = false;
  for (int i = 0; i < len; i++) {
    bool f = false;
    char old = s[i];
    for (char ch = ok ? 'a' : old; !f && ch <= 'z'; ch++) {
      s[i] = ch;
      f |= check(i);
    }
    while (!f) {
      if (!plusone(i, tmp)) {
        puts("Impossible");
        return 0;
      } else {
        i = tmp;
        ok = true;
        f |= check(i);
      }
    }
    insert(i);
    if (!ok && s[i] != old) ok = true;
  }
  puts(s);
  return 0;
}
