#include <bits/stdc++.h>
using namespace std;
const long long N = 4e5 + 12, base = 17971, MOD = 1e9 + 7;
long long n, d, pw[N], inv[N];
long long H1[N], H2[N];
string s, S;
long long sum(long long a, long long b) {
  a += b;
  if (a < 0) a += MOD;
  if (a >= MOD) a -= MOD;
  return a;
}
long long mul(long long a, long long b) { return (a * b) % MOD; }
void init();
void solve();
void out(bool);
void pre();
void add(char, long long);
bool check(long long, long long);
long long G_H_1(long long, long long);
long long G_H_2(long long, long long);
long long POW(long long a, long long p) {
  if (p == 0) return 1;
  long long b = POW(a, p / 2);
  b = mul(b, b);
  if (p % 2) return mul(b, a);
  return b;
}
int32_t main() {
  pre();
  init();
  solve();
  out(0);
  return 0;
}
void pre() {
  pw[0] = 1;
  for (long long i = 1; i < N; i++) pw[i] = mul(pw[i - 1], base);
  inv[0] = 1;
  long long val = POW(base, MOD - 2);
  for (long long i = 1; i < N; i++) inv[i] = mul(inv[i - 1], val);
  return;
}
void init() {
  cin >> d >> s;
  n = s.size();
  s = '?' + s;
  s[n]++;
  return;
}
void solve() {
  long long fir = 1e9;
  for (long long i = 1; i <= n; i++) {
    if (i > fir) s[i] = 'a';
    char FIRST_CHAR = s[i];
    for (; s[i] <= 'z'; s[i]++) {
      add(s[i], i);
      if (check(i - d + 1, i) || check(i - d, i)) continue;
      break;
    }
    if (s[i] > 'z') {
      if (i == 1) out(1);
      fir = i - 1;
      s[i - 1]++;
      i -= 2;
      continue;
    }
    if (s[i] > FIRST_CHAR) fir = i;
  }
}
bool check(long long l, long long r) {
  if (l <= 0) return 0;
  return (G_H_1(l, r) == G_H_2(l, r));
}
void add(char C, long long id) {
  H1[id] = sum(mul(H1[id - 1], base), C);
  H2[id] = sum(mul(C, pw[id - 1]), H2[id - 1]);
  return;
}
void out(bool C) {
  if (C)
    cout << "Impossible";
  else {
    for (long long i = 1; i <= n; i++) cout << s[i];
  }
  exit(0);
}
long long G_H_1(long long l, long long r) {
  return sum(H1[r], -mul(H1[l - 1], pw[r - l + 1]));
}
long long G_H_2(long long l, long long r) {
  return mul(sum(H2[r], -H2[l - 1]), inv[l - 1]);
}
