#include <bits/stdc++.h>
using namespace std;
const int P = 4993;
const int N = (int)1e6;
const int MOD = (int)1e9 + 7;
int m;
char s[N], t[N];
long long a[N], b[N], p[N];
bool can(int x, int y) {
  x++;
  if (x < y) {
    return true;
  }
  long long l = (a[x] - a[x - y] * p[y] % MOD + MOD) % MOD;
  long long r = (b[x] - b[x - y] + MOD) % MOD;
  return l * p[x - y] % MOD != r;
}
void dfs(int x, int n, bool y, bool &found) {
  if (x == n) {
    t[n] = '\0';
    printf("%s\n", t);
    found = true;
    return;
  }
  for (t[x] = (y ? s[x] : 'a'); t[x] <= 'z'; t[x]++) {
    a[x + 1] = (a[x] * P + t[x]) % MOD;
    b[x + 1] = (b[x] + t[x] * p[x]) % MOD;
    if (can(x, m) && can(x, m + 1)) {
      dfs(x + 1, n, y && (t[x] == s[x]), found);
    }
    if (found) {
      return;
    }
  }
}
int main() {
  scanf("%d %s", &m, s);
  int n = strlen(s);
  int w = n - 1;
  bool found = false;
  while (w >= 0 && s[w] == 'z') {
    s[w] = 'a';
    w--;
  }
  if (w < 0) {
    puts("Impossible");
    exit(0);
  }
  s[w]++;
  p[0] = 1;
  for (int i = 1; i < N; i++) {
    p[i] = p[i - 1] * P % MOD;
  }
  dfs(0, n, true, found);
  if (!found) {
    puts("Impossible");
  }
  return 0;
}
