#include <bits/stdc++.h>
using namespace std;
const int N = 400005;
using ll = long long;
const ll P = 998244353, M = 5;
int n, d;
ll pw[N], inv[N];
char s[N], p[N];
ll qpow(ll a, ll b) {
  ll ret = 1;
  while (b) {
    if (b & 1) ret = ret * a % P;
    a = a * a % P;
    b >>= 1;
  }
  return ret;
}
inline int lowbit(int x) { return x & -x; }
ll c1[N], c2[N];
void add(ll c[], int pos, ll v) {
  while (pos <= n) c[pos] = (c[pos] + v) % P, pos += lowbit(pos);
}
ll query(ll c[], int pos) {
  ll ret = 0;
  while (pos) ret += c[pos], pos -= lowbit(pos);
  return ret % P;
}
bool inc(int pos) {
  while (s[pos] == 'z') {
    if (pos == 1) return 0;
    add(c1, pos, P - (s[pos] - 'a') * pw[pos] % P);
    add(c2, n - pos + 1, P - (s[pos] - 'a') * pw[n - pos + 1] % P);
    s[pos] = 'a';
    --pos;
  }
  add(c1, pos, P - (s[pos] - 'a') * pw[pos] % P);
  add(c2, n - pos + 1, P - (s[pos] - 'a') * pw[n - pos + 1] % P);
  ++s[pos];
  add(c1, pos, (s[pos] - 'a') * pw[pos] % P);
  add(c2, n - pos + 1, (s[pos] - 'a') * pw[n - pos + 1] % P);
  return 1;
}
bool check(int l, int r) {
  if (l <= 0) return 1;
  ll h1 = (query(c1, r) - query(c1, l - 1) + P) * inv[l - 1] % P,
     h2 = (query(c2, n - l + 1) - query(c2, n - r) + P) * inv[n - r] % P;
  return h1 != h2;
}
inline bool ok(int pos) {
  return check(pos - d + 1, pos) && check(pos - d, pos);
}
int main() {
  ios::sync_with_stdio(false);
  cin >> d >> (s + 1);
  n = strlen(s + 1);
  strcpy(p + 1, s + 1);
  if (n == 1) {
    cout << "Impossible" << endl;
    return 0;
  }
  pw[0] = inv[0] = 1;
  ll invm = qpow(M, P - 2);
  for (int i = 1; i <= n; i++)
    pw[i] = pw[i - 1] * M % P, inv[i] = inv[i - 1] * invm % P;
  for (int i = 1; i <= n; i++)
    add(c1, i, (s[i] - 'a') * pw[i] % P),
        add(c2, n - i + 1, (s[i] - 'a') * pw[n - i + 1] % P);
  int pos = d;
  while (pos < n && ok(pos)) ++pos;
  do
    if (!inc(pos)) {
      cout << "Impossible" << endl;
      return 0;
    }
  while (!ok(pos));
  for (int i = pos - 1; i >= d; --i)
    while (!ok(i))
      if (!inc(i)) {
        cout << "Impossible" << endl;
        return 0;
      }
  pos = 1;
  while (pos < n && s[pos] == p[pos]) ++pos;
  for (int i = pos + 1; i <= n; i++) {
    add(c1, i, P - (s[i] - 'a') * pw[i] % P);
    add(c2, n - i + 1, P - (s[i] - 'a') * pw[n - i + 1] % P);
    s[i] = 'a';
    while (!ok(i)) inc(i);
  }
  cout << (s + 1) << endl;
  return 0;
}
