#include <bits/stdc++.h>
using namespace std;
const int N = 400010;
int d, s, n;
unsigned long long lh[N], rh[N];
unsigned long long mi[N];
unsigned long long p = 211;
char a[N];
char ans[N];
bool hw(int x, int len) {
  int st = x - len + 1;
  if (st < 0) return 1;
  if ((rh[x + 1] - rh[st] * mi[len]) * mi[st] != lh[x + 1] - lh[st]) return 1;
  return 0;
}
bool dfs(int x, int t) {
  if (x == n) {
    printf("%s", ans);
    return 1;
  }
  for (int i = (t ? a[x] : 'a'); i <= 'z'; i++) {
    ans[x] = i;
    lh[x + 1] = lh[x] + mi[x] * i;
    rh[x + 1] = rh[x] * p + i;
    if (hw(x, d) && hw(x, d + 1))
      if (dfs(x + 1, t && (i == a[x]))) return 1;
  }
  return 0;
}
int main() {
  scanf("%d", &d);
  scanf("%s", a);
  n = strlen(a);
  int i = n - 1;
  while (a[i] == 'z') a[i] = 'a', i--;
  if (i == -1) {
    printf("Impossible\n");
    return 0;
  }
  a[i]++;
  mi[0] = 1;
  for (int i = 1; i < n; i++) mi[i] = mi[i - 1] * p;
  if (dfs(0, 1)) {
  } else
    printf("Impossible\n");
}
