#include <bits/stdc++.h>
using namespace std;
const int N = 1e6;
int str[N], n, m;
int ans[N];
unsigned long long num[N], pre[N], suf[N];
inline void dfs(int i, bool t) {
  if (i > n) {
    for (i = 1; i <= n; i++) putchar(ans[i] + 'a' - 1);
    exit(0);
  }
  for (int j = t ? str[i] : 1; j <= 26; j++) {
    pre[i] = pre[i - 1] + j * num[i];
    suf[i] = suf[i - 1] + j * num[n - i + 1];
    if (i >= m && (pre[i] - pre[i - m]) * num[n - (i - m)] ==
                      (suf[i] - suf[i - m]) * num[i])
      continue;
    if (i > m && (pre[i] - pre[i - m - 1]) * num[n - (i - m - 1)] ==
                     (suf[i] - suf[i - m - 1]) * num[i])
      continue;
    ans[i] = j;
    dfs(i + 1, t && j == str[i]);
  }
}
int main() {
  int i;
  char c;
  scanf("%d", &m);
  const unsigned long long seed = 131;
  while ((c = getchar()) < 'a' || 'z' < c)
    ;
  while ('a' <= c && c <= 'z') str[++n] = c - 'a' + 1, c = getchar();
  for (i = n; str[i] == 26; i--) str[i] = 1;
  if (i)
    str[i]++;
  else
    return puts("Impossible"), 0;
  for (i = num[0] = 1; i <= n; i++) num[i] = num[i - 1] * seed;
  dfs(1, 1);
  puts("Impossible");
  return 0;
}
