#include <bits/stdc++.h>
using namespace std;
const int MAXN = 4e5 + 123;
const long long mod = 1e9 + 7;
const long long P = 3137;
long long Pinv = -1;
struct Loga {
  int n;
  vector<long long> data;
  Loga(int n) : n(n), data(n + 1, 0) {}
  long long query(int x) {
    long long sum = 0;
    for (; x; x -= x & -x) sum += data[x];
    return sum;
  }
  long long query(int a, int b) { return query(b) - query(a); }
  void update(int x, long long delta) {
    for (++x; x < (int)data.size(); x += x & -x) data[x] += delta;
  }
};
long long Ppot[MAXN], Pinvpot[MAXN];
struct HS {
  int len;
  vector<char> S;
  Loga loga;
  HS(int len) : len(len), S(len, 0), loga(len) {}
  void update(int x, char c) {
    loga.update(x, -Ppot[x] * S[x] % mod);
    S[x] = c;
    loga.update(x, +Ppot[x] * S[x] % mod);
  }
  long long get_hash(int a, int b) {
    long long ans = loga.query(a, b) % mod;
    ans = ans * Pinvpot[a] % mod;
    return ans;
  }
};
int main(void) {
  {
    static long long invs[P + 1];
    invs[1] = 1;
    for (long long i = 2; i <= P; ++i)
      invs[i] = (mod - mod / i) * invs[mod % i] % mod;
    Pinv = invs[P];
    assert(P * Pinv % mod == 1);
    Ppot[0] = 1;
    for (int i = 0; i < (MAXN); ++i) Ppot[i + 1] = Ppot[i] * P % mod;
    Pinvpot[0] = 1;
    for (int i = 0; i < (MAXN); ++i) Pinvpot[i + 1] = Pinvpot[i] * Pinv % mod;
  }
  int d;
  scanf("%d", &d);
  static char buff[MAXN];
  scanf("%s", buff);
  int len = strlen(buff);
  HS norm(len), rev(len);
  auto update = [&](int x, char c) {
    norm.update(x, c);
    rev.update(len - 1 - x, c);
  };
  for (int i = 0; i < (len); ++i) update(i, buff[i]);
  auto bad_last = [&](int x) {
    if (x + 1 - d >= 0) {
      long long Anorm = norm.get_hash(x + 1 - d, x + 1);
      long long Arev = rev.get_hash(len - (x + 1), len - (x + 1 - d));
      if (Anorm == Arev) return true;
    }
    if (x + 1 - (d + 1) >= 0) {
      long long Bnorm = norm.get_hash(x + 1 - (d + 1), x + 1);
      long long Brev = rev.get_hash(len - (x + 1), len - (x + 1 - (d + 1)));
      if (Bnorm == Brev) return true;
    }
    return false;
  };
  int ptr = 0;
  for (int i = 0; i < (len + 1); ++i) {
    ptr = i;
    if (i < len)
      if (bad_last(i)) break;
  }
  if (ptr == len) ptr = len - 1;
  do {
    if (buff[ptr] == 'z') {
      --ptr;
      continue;
    }
    ++buff[ptr];
    update(ptr, buff[ptr]);
    if (!bad_last(ptr)) break;
  } while (ptr >= 0);
  if (ptr == -1) {
    puts("Impossible");
    exit(0);
  }
  ++ptr;
  while (ptr < len) {
    char c;
    for (c = 'a'; c <= 'z'; ++c) {
      buff[ptr] = c;
      update(ptr, c);
      if (!bad_last(ptr)) break;
    }
    assert(c <= 'z');
    ++ptr;
  }
  puts(buff);
  return 0;
}
