#include <bits/stdc++.h>
using namespace std;
int d, n, p[400005], h1[400005], h2[400005];
bool fl;
char s[400005], ans[400005];
bool check(int x, int d) {
  if (x < d) return 0;
  return (h1[x] - (long long)h1[x - d] * p[d] % 1000000007 + 1000000007) *
             p[x - d] % 1000000007 ==
         (h2[x] - h2[x - d] + 1000000007) % 1000000007;
}
void dfs(int x, bool y) {
  if (x > n) {
    if (y) fl = 1;
    return;
  }
  for (int i = y ? 'a' : s[x]; i <= 'z'; i++) {
    if (fl) return;
    h1[x] = ((long long)h1[x - 1] * p[1] + (i - 'a')) % 1000000007,
    h2[x] = (h2[x - 1] + (long long)(i - 'a') * p[x - 1]) % 1000000007;
    if (!check(x, d) && !check(x, d + 1)) ans[x] = i, dfs(x + 1, y | i > s[x]);
  }
}
int main() {
  scanf("%d%s", &d, s + 1), n = strlen(s + 1), p[0] = 1;
  for (int i = 1; i <= n; i++)
    p[i] = (long long)p[i - 1] * 1000003 % 1000000007;
  dfs(1, 0), puts(fl ? ans + 1 : "Impossible");
  return 0;
}
