#include <bits/stdc++.h>
using namespace std;
char ans[400005], s[400005];
unsigned int Exp[400005], l[400005], r[400005];
int n, m;
inline bool can(int i, int x) {
  if (++i < x) return 1;
  return (r[i] - r[i - x] * Exp[x]) * Exp[i - x] != l[i] - l[i - x];
}
int dfs(int i, int has) {
  if (i == n) return puts(ans), 1;
  for (ans[i] = (has ? s[i] : 'a'); ans[i] <= 'z'; ++ans[i]) {
    l[i + 1] = l[i] + ans[i] * Exp[i];
    r[i + 1] = r[i] * 123127 + ans[i];
    if (can(i, m) && can(i, m + 1) && dfs(i + 1, has && (s[i] == ans[i])))
      return 1;
  }
  return 0;
}
int main() {
  scanf("%d%s", &m, &s);
  int i = (n = strlen(s)) - 1;
  for (; i >= 0 && s[i] == 'z'; --i) s[i] = 'a';
  if (i < 0) return puts("Impossible"), 0;
  ++s[i];
  Exp[0] = 1;
  for (int i = 1; i <= n; ++i) Exp[i] = Exp[i - 1] * 123127;
  if (!dfs(0, 1)) puts("Impossible");
  return 0;
}
