#include <bits/stdc++.h>
using namespace std;
inline int in() {
  int32_t x;
  scanf("%d", &x);
  return x;
}
inline string gets() {
  char ch[1000000];
  scanf("%s", ch);
  return ch;
}
template <class P, class Q>
inline P smin(P &a, Q b) {
  if (b < a) a = b;
  return a;
}
template <class P, class Q>
inline P smax(P &a, Q b) {
  if (a < b) a = b;
  return a;
}
const int MAX_LG = 17;
const long long maxn = 4e5 + 10;
const long long base = 29;
const long long mod = 1e9 + 7;
const long long INF = 1e9;
const long long maxq = 2e5 + 10;
string s;
long long d, n, id, pw[maxn];
long long fen[maxn][2], rev[maxn];
inline void update(long long p, long long val, long long tp = 0) {
  if (p == 0 || val == 0) return;
  for (; p < maxn; p += p & -p) fen[p][tp] = (fen[p][tp] + val) % mod;
}
inline long long power(long long a, long long b) {
  if (!b) return 1;
  return power(a * a % mod, b >> 1) * (b % 2 ? a : 1) % mod;
}
inline void ok(long long &a) {
  if (a < 0)
    a += mod;
  else if (a > mod)
    a -= mod;
}
inline long long get(long long p, long long tp) {
  if (p == 0) return 0;
  long long ret = 0;
  for (; p > 0; p -= p & -p) ret += fen[p][tp], ok(ret);
  return ret;
}
inline bool isPal(long long x, long long y) {
  long long pref = get(y + 1, 0) - get(x, 0);
  ok(pref);
  long long suf = get(n - x, 1) - (n - y - 1 ? get(n - y - 1, 1) : 0);
  ok(suf);
  pref = pref * rev[x + 1] % mod;
  suf = suf * rev[n - y] % mod;
  return pref == suf;
}
bool fl = true;
inline bool check(long long x) {
  bool ret = 0;
  if (x >= d - 1) ret |= isPal(x - d + 1, x);
  if (!ret && x >= d) ret |= isPal(x - d, x);
  return ret;
}
int32_t main() {
  pw[0] = 1, rev[0] = 1;
  for (long long i = 1; i < maxn; i++)
    pw[i] = pw[i - 1] * base % mod, rev[i] = power(pw[i], mod - 2);
  d = in();
  s = gets();
  n = (long long)s.size();
  id = n - 1;
  for (long long i = 0; i < n; i++) {
    fl &= s[i] == 'z';
    update(i + 1, (s[i] - 'a' + 1) * pw[i + 1]);
    update(n - i, (s[i] - 'a' + 1) * pw[n - i], 1);
  }
  if (fl) return cout << "Impossible\n", 0;
  if (isPal(0, d - 1))
    id = d - 1;
  else {
    for (long long i = d; i < n; i++) {
      if (check(i)) {
        id = i;
        break;
      }
    }
  }
  bool ok = false;
  while (id >= 0 && ok == false) {
    if (s[id] == 'z') {
      id--;
      if (id >= 0 && s[id] < 'z') {
        update(id + 1, pw[id + 1]);
        update(n - id, pw[n - id], 1);
        s[id]++;
        ok |= !check(id);
      }
    } else {
      bool fl = true;
      while (fl && s[id] < 'z') {
        update(id + 1, pw[id + 1]);
        update(n - id, pw[n - id], 1);
        s[id]++;
        fl &= check(id);
        if (!fl) {
          ok = true;
          break;
        }
      }
      if (fl && s[id] == 'z') {
        id--;
        if (id >= 0 && s[id] < 'z') {
          update(id + 1, pw[id + 1]);
          update(n - id, pw[n - id], 1);
          s[id]++;
          ok |= !check(id);
        }
      }
    }
  }
  if (id == -1) return cout << "Impossible\n", 0;
  for (long long i = id + 1; i < n; i++) {
    for (long long j = 0; j < 3; j++) {
      if (j + 'a' != s[i]) {
        update(i + 1, pw[i + 1] * (-(s[i] - 'a' - j)));
        update(n - i, pw[n - i] * (-(s[i] - 'a' - j)), 1);
      }
      s[i] = j + 'a';
      if (j == 2 || !check(i)) {
        break;
      }
    }
  }
  cout << s << "\n";
}
