#include <bits/stdc++.h>
using namespace std;
const long long inf = 100000000000000000LL;
const unsigned int Hash = 1000000007;
int i, j, n, d;
unsigned int l[500000], r[500000], p[500000];
char s[500000], ans[500000];
bool ok(int i, int d) {
  if (i + 1 < d) return 0;
  unsigned int left = l[i];
  unsigned int right = r[i];
  if (i - d != -1) {
    left -= l[i - d];
    right -= r[i - d] * p[d];
  }
  right *= p[i - d + 1];
  return left == right;
}
bool dfs(int x, int bound) {
  if (x == n) {
    if (!bound)
      return 1;
    else
      return 0;
  }
  int lim;
  if (bound)
    lim = s[x];
  else
    lim = 'a';
  for (int i = lim; i <= 'z'; i++) {
    ans[x] = i;
    if (x > 0) {
      l[x] = l[x - 1];
      r[x] = r[x - 1] * Hash;
    }
    l[x] += p[x] * i;
    r[x] += i;
    if (!ok(x, d) && !ok(x, d + 1)) {
      int nbound;
      if (bound == 1 && i == s[x])
        nbound = 1;
      else
        nbound = 0;
      if (dfs(x + 1, nbound)) return 1;
    }
  }
  return 0;
}
int main() {
  scanf("%d", &d);
  scanf("%s", s);
  n = strlen(s);
  p[0] = 1;
  for (i = 1; i < n; i++) p[i] = p[i - 1] * Hash;
  if (dfs(0, 1))
    printf("%s", ans);
  else
    printf("Impossible\n");
  return 0;
}
