#include <bits/stdc++.h>
using namespace std;
const int N = 400005;
const long long p = 19260817;
const long long mod = 1000000007;
int n, d;
long long hashl[N], hashr[N], Pow[N];
char s[N];
int POS;
bool Next(int i) {
  while (i >= 1 && s[i] == 'z') {
    s[i] = 'a';
    i--;
  }
  if (i < 1) return false;
  s[i]++;
  POS = i;
  return true;
}
bool Pal(int l, int r) {
  long long h1 = (hashl[r] - hashl[l - 1] * Pow[r - l + 1] % mod + mod) % mod *
                 Pow[l - 1] % mod;
  long long h2 = (hashr[r] - hashr[l - 1] + mod) % mod;
  return h1 == h2;
}
int main() {
  scanf("%d", &d);
  scanf("%s", s + 1);
  n = strlen(s + 1);
  if (d == 1 || !Next(n)) {
    puts("Impossible");
    return 0;
  }
  Pow[0] = 1;
  for (int i = 1; i <= n; i++) Pow[i] = Pow[i - 1] * p % mod;
  hashl[0] = hashr[0] = 0;
  for (int i = 1; i <= n; i++) {
    hashl[i] = (hashl[i - 1] * p + s[i]) % mod;
    hashr[i] = (hashr[i - 1] + Pow[i - 1] * s[i]) % mod;
  }
  POS = n;
  for (int i = 1; i <= n; i++) {
    if (i > POS) s[i] = 'a';
    hashl[i] = (hashl[i - 1] * p + s[i]) % mod;
    hashr[i] = (hashr[i - 1] + Pow[i - 1] * s[i]) % mod;
    if ((i >= d && Pal(i - d + 1, i)) || (i >= d + 1 && Pal(i - d, i))) {
      if (!Next(i)) {
        puts("Impossible");
        return 0;
      }
      i = POS - 1;
    }
  }
  puts(s + 1);
  return 0;
}
