#include <bits/stdc++.h>
using namespace std;
const int maxn = 400010, p = 43;
int n, d;
char s[maxn], t[maxn];
unsigned long long pw[maxn], h[maxn], rh[maxn];
bool chk(int ed, int l) {
  int st = ++ed - l + 1;
  if (st < 0) return 1;
  return (rh[ed] - rh[st - 1] * pw[l]) * pw[st - 1] != h[ed] - h[st - 1];
}
bool dfs(int i, int v) {
  if (i == n) {
    printf("%s\n", t);
    return 1;
  }
  for (t[i] = v ? s[i] : 'a'; t[i] <= 'z'; t[i]++) {
    h[i + 1] = h[i] + t[i] * pw[i];
    rh[i + 1] = rh[i] * p + t[i];
    if (chk(i, d) && chk(i, d + 1) && dfs(i + 1, v && s[i] == t[i])) return 1;
  }
  return 0;
}
int main() {
  scanf("%d %s", &d, s), n = strlen(s);
  int i = n - 1;
  for (; i >= 0 && s[i] == 'z'; i--) s[i] = 'a';
  if (i < 0) printf("Impossible\n"), exit(0);
  s[i]++, pw[0] = 1;
  for (int i = 1; i <= n; i++) pw[i] = p * pw[i - 1];
  if (!dfs(0, 1)) printf("Impossible\n");
  return 0;
}
