#include <bits/stdc++.h>
using namespace std;
const int N = 400010;
const int P = 10000007;
int m, n;
char str[N];
char ans[N];
int l[N], r[N];
int p[N];
bool ok(int i, int m) {
  if (++i < m) return 0;
  return (r[i] - r[i - m]) == ((l[i] - l[i - m] * p[m]) * p[i - m]);
}
int dfs(int i, int ismax) {
  if (i == n) {
    puts(ans);
    return 1;
  }
  for (ans[i] = ismax ? str[i] : 'a'; ans[i] <= 'z'; ans[i]++) {
    l[i + 1] = l[i] * P + ans[i];
    r[i + 1] = r[i] + ans[i] * p[i];
    if (!ok(i, m) && !ok(i, m + 1) && dfs(i + 1, ans[i] == str[i] && ismax))
      return 1;
  }
  return 0;
}
int main() {
  scanf("%d%s", &m, str);
  n = strlen(str);
  int i = n - 1;
  for (; i >= 0 && str[i] == 'z'; i--) str[i] = 'a';
  if (i < 0) {
    puts("Impossible");
    return 0;
  }
  str[i]++;
  p[0] = 1;
  for (int i = 1; i <= n; i++) p[i] = p[i - 1] * P;
  if (!dfs(0, 1)) puts("Impossible");
  return 0;
}
