#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const long long H = 77052771;
int d, n;
string s;
long long front[400100], back[400100], tmp[400100];
int bad;
bool P(int a) {
  long long frontHash, backHash;
  if (a >= d - 1) {
    frontHash = (front[a] - ((a == d - 1) ? 0 : front[a - d] * tmp[d] % MOD) +
                 MOD * 2) %
                MOD;
    backHash = (back[a] - ((a == d - 1) ? 0 : back[a - d]) + MOD * 2) % MOD;
    frontHash = frontHash * ((a == d - 1) ? 1 : tmp[a - d + 1]) % MOD;
    if (frontHash == backHash) return true;
  }
  if (a >= d) {
    frontHash =
        (front[a] - ((a == d) ? 0 : front[a - d - 1] * tmp[d + 1] % MOD) +
         MOD * 2) %
        MOD;
    backHash = (back[a] - ((a == d) ? 0 : back[a - d - 1]) + MOD * 2) % MOD;
    frontHash = frontHash * ((a == d) ? 1 : tmp[a - d]) % MOD;
    if (frontHash == backHash) return true;
  }
  return false;
}
int main() {
  scanf("%d", &d);
  cin >> s;
  n = s.size();
  bad = n - 1;
  for (int i = 0; i < n; i++) tmp[i] = (i == 0) ? 1 : (tmp[i - 1] * H % MOD);
  for (int i = 0; i < n; i++) {
    front[i] =
        (((i == 0) ? 0 : front[i - 1]) * H % MOD + (s[i] - 'a' + 1)) % MOD;
    back[i] =
        (((i == 0) ? 0 : back[i - 1]) + tmp[i] * (s[i] - 'a' + 1) % MOD) % MOD;
    if (P(i)) {
      bad = i;
      break;
    }
  }
  int chk = 0;
  for (int i = bad; i >= 0; i--) {
    for (int j = (s[i] - 'a' + 2); j <= 26; j++) {
      front[i] = (((i == 0) ? 0 : front[i - 1]) * H % MOD + j) % MOD;
      back[i] = (((i == 0) ? 0 : back[i - 1]) + tmp[i] * j % MOD) % MOD;
      s[i] = 'a' + j - 1;
      if (!P(i)) {
        chk = 1;
        break;
      }
    }
    if (chk) {
      bad = i + 1;
      break;
    }
  }
  if (!chk) {
    puts("Impossible");
    return 0;
  }
  for (int i = bad; i < n; i++) {
    for (int j = 1; j <= 26; j++) {
      front[i] = (((i == 0) ? 0 : front[i - 1]) * H % MOD + j) % MOD;
      back[i] = (((i == 0) ? 0 : back[i - 1]) + tmp[i] * j % MOD) % MOD;
      s[i] = 'a' + j - 1;
      if (!P(i)) {
        break;
      }
    }
  }
  cout << s << endl;
  return 0;
}
