#include <bits/stdc++.h>
using namespace std;
const int tmp = 1000007;
int n, m, i, j, k, x, y, z, last, t;
char s[tmp];
char a[tmp];
int h[tmp];
int hl[tmp];
int hr[tmp];
bool ok, okk = false;
bool chk(int R, int l) {
  int L = R - l;
  if (L < 0)
    return true;
  else
    return (hl[R] - hl[L] * h[l]) * h[L + 1] != hr[R] - hr[L];
}
void dfs(int x, bool ok) {
  if (x > n) {
    puts(a + 1);
    okk = true;
    exit(0);
  }
  for (char c = ok ? 'a' : s[x]; c <= 'z'; ++c) {
    a[x] = c;
    hr[x] = hr[x - 1] + c * h[x];
    hl[x] = hl[x - 1] * tmp + c;
    if (chk(x, m) && chk(x, m + 1)) {
      dfs(x + 1, ok || c > s[x]);
      if (okk) return;
    }
  }
}
int main() {
  h[0] = 1;
  scanf("%d%s", &m, s + 1);
  n = strlen(s + 1);
  for (i = 1; i <= n; i++) h[i] = h[i - 1] * tmp;
  t = n;
  while (t && s[t] == 'z') s[t--] = 'a';
  if (!t) return puts("Impossible"), 0;
  s[t]++;
  dfs(1, 0);
  if (!okk) return puts("Impossible"), 0;
  return 0;
}
