#include <bits/stdc++.h>
using namespace std;
const int MAXN = 4e5 + 10;
const int MOD = 1e9 + 7, BASE = 19366439;
int add(int x, int y) { return (x + y) % MOD; }
int subtr(int x, int y) {
  x -= y;
  if (x < 0) {
    x += MOD;
  }
  return x;
}
int mult(int x, int y) { return 1ll * x * y % MOD; }
void kill() {
  puts("Impossible");
  exit(0);
}
int N, D;
char S[MAXN], ans[MAXN];
int pwr[MAXN], fwd[MAXN], rev[MAXN];
bool palin(int lt, int rt) {
  if (lt < 0) {
    return false;
  }
  return mult(subtr(fwd[rt + 1], fwd[lt]), pwr[N - lt]) ==
         mult(subtr(rev[rt + 1], rev[lt]), pwr[rt]);
}
void add(int i, char c) {
  ans[i] = c;
  fwd[i + 1] = add(fwd[i], mult(c, pwr[i]));
  rev[i + 1] = add(rev[i], mult(c, pwr[N - i]));
}
bool safe(int i) { return !palin(i - (D - 1), i) && !palin(i - D, i); }
int main() {
  scanf("%d %s", &D, S);
  N = strlen(S);
  bool found = false;
  for (int i = N - 1; i >= 0; i--) {
    if (S[i] == 'z') {
      S[i] = 'a';
    } else {
      S[i]++;
      found = true;
      break;
    }
  }
  if (!found) {
    kill();
  }
  pwr[0] = 1;
  for (int i = 1; i < MAXN; i++) {
    pwr[i] = mult(pwr[i - 1], BASE);
  }
  found = false;
  for (int i = 0; i < N; i++) {
    if (!found) {
      add(i, S[i]);
      if (!safe(i)) {
        for (; i >= 0; i--) {
          for (char c = S[i] + 1; c <= 'z'; c++) {
            add(i, c);
            if (safe(i)) {
              found = true;
              break;
            }
          }
          if (found) {
            break;
          }
        }
        if (!found) {
          kill();
        }
      }
    } else {
      found = false;
      for (char c = 'a'; c <= 'z'; c++) {
        add(i, c);
        if (safe(i)) {
          found = true;
          break;
        }
      }
      if (!found) {
        kill();
      }
    }
  }
  puts(ans);
}
