#include <bits/stdc++.h>
using namespace std;
const int N = 400005;
int n;
int d;
char S[N];
const int B = 31337;
const long long MOD = 1000000007;
int POT[N];
int INV[N];
struct fenwick {
  long long tree[400100];
  int n;
  fenwick() {
    memset(tree, 0, sizeof(tree));
    n = 400009;
  }
  inline void add(int x, int val, int sgn) {
    for (++x; x < n; x += x & -x) {
      if (sgn == -1)
        tree[x] -= val;
      else
        tree[x] += val;
      if (tree[x] >= MOD) tree[x] -= MOD;
      if (tree[x] < 0) tree[x] += MOD;
    }
  }
  inline int get(int x) {
    int ans = 0;
    for (++x; x > 0; x -= x & -x) {
      ans += tree[x];
      if (ans >= MOD) ans -= MOD;
    }
    return ans;
  }
} HR, H;
inline void load() {
  scanf("%d", &d);
  scanf("%s", S);
  n = strlen(S);
  POT[0] = 1;
  for (int i = 1; i < N; i++) POT[i] = (long long)POT[i - 1] * B % MOD;
  for (int i = 0; i < n; i++) H.add(i, (long long)POT[i] * S[i] % MOD, 1);
  for (int i = n - 1; i >= 0; i--)
    HR.add(n - i - 1, (long long)POT[n - 1 - i] * S[i] % MOD, 1);
}
inline int powi(long long a, int b) {
  long long sol = 1;
  for (; b; b >>= 1) {
    if (b & 1) sol *= a, sol %= MOD;
    a *= a;
    a %= MOD;
  }
  return sol;
}
inline int hash1(int x, int y) {
  return ((long long)H.get(y) - H.get(x - 1) + MOD) % MOD * INV[x] % MOD;
}
inline int hash2(int x, int y) {
  x = n - x - 1;
  y = n - y - 1;
  return ((long long)HR.get(x) - HR.get(y - 1) + MOD) % MOD * INV[y] % MOD;
}
bool AA;
inline bool check(int x, int y) {
  if (x < 0) return false;
  return (hash1(x, y) == hash2(x, y));
}
inline int first_subtask() {
  for (int i = 0; i < N; i++) INV[i] = powi(POT[i], MOD - 2);
  for (int i = 0; i < n; i++) {
    if (check(i - d + 1, i) || check(i - d, i)) return i;
  }
  return n - 1;
}
inline int f(char a) { return a - 97; }
inline int second_subtask() {
  int index = first_subtask();
  bool ok = false;
  while (index >= 0) {
    for (int j = f(S[index]) + 1; j <= f('z'); j++) {
      H.add(index, (long long)POT[index] * S[index] % MOD, -1);
      HR.add(n - 1 - index, (long long)POT[n - 1 - index] * S[index] % MOD, -1);
      S[index] = j + 'a';
      H.add(index, (long long)POT[index] * S[index] % MOD, 1);
      HR.add(n - 1 - index, (long long)POT[n - 1 - index] * S[index] % MOD, 1);
      if (check(index - d + 1, index) || check(index - d, index)) continue;
      ok = true;
      break;
    }
    if (ok) break;
    index--;
  }
  if (index == -1) return -1;
  return index + 1;
}
inline void solve() {
  int aa = second_subtask();
  if (aa == -1) {
    printf("Impossible\n");
    return;
  }
  for (int i = aa; i < n; i++) {
    for (int j = 0; j <= 2; j++) {
      H.add(i, (long long)POT[i] * S[i] % MOD, -1);
      HR.add(n - 1 - i, (long long)POT[n - 1 - i] * S[i] % MOD, -1);
      S[i] = j + 'a';
      H.add(i, (long long)POT[i] * S[i] % MOD, 1);
      HR.add(n - 1 - i, (long long)POT[n - 1 - i] * S[i] % MOD, 1);
      if (check(i - d + 1, i) || check(i - d, i)) continue;
      break;
    }
  }
  printf("%s\n", S);
}
int main(void) {
  load();
  solve();
  return 0;
}
