#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
inline long long pow2(long long a, long long b) {
  a %= mod;
  long long res = 1;
  while (b > 0) {
    if (b & 1) res = res * a % mod;
    b >>= 1;
    a = a * a % mod;
  }
  return res;
}
inline long long getInv(long long x) { return pow2(x, mod - 2); }
long long mult, Hash[400010], revHash[400010], power[400010], inv[400010];
mt19937 ran(time(nullptr));
char str[400010], change[400010];
int d, n;
inline void changeChar(int pos, char ch) {
  Hash[pos] = (Hash[pos - 1] + ch * power[n - pos]) % mod;
  revHash[pos] = (revHash[pos - 1] + ch * power[pos - 1]) % mod;
}
inline long long getHash(int l, int r) {
  return (Hash[r] + mod - Hash[l - 1]) % mod * inv[n - r] % mod;
}
inline long long getRevHash(int l, int r) {
  return (revHash[r] + mod - revHash[l - 1]) % mod * inv[l - 1] % mod;
}
inline bool check(int len, int ed) {
  if (len == 1) return true;
  if (len > ed) return false;
  if (getHash(ed - len + 1, ed - len + 1 + len / 2 - 1) ==
      getRevHash(ed - len / 2 + 1, ed))
    return true;
  return false;
}
bool dfs(int idx, bool isGreater) {
  if (idx > n) return true;
  for (change[idx] = (isGreater ? 'a' : str[idx]); change[idx] <= 'z';
       change[idx]++) {
    changeChar(idx, change[idx]);
    if (!check(d, idx) && !check(d + 1, idx) &&
        dfs(idx + 1, isGreater || (change[idx] > str[idx])))
      return true;
  }
  return false;
}
int main() {
  mult = ran() % mod;
  scanf("%d%s", &d, str + 1);
  n = strlen(str + 1);
  inv[0] = power[0] = 1;
  long long multInv = getInv(mult);
  for (int i = 1; i <= n; i++) {
    power[i] = power[i - 1] * mult % mod;
    inv[i] = inv[i - 1] * multInv % mod;
  }
  int must_greater = -1;
  for (int i = n; i >= 1; i--) {
    if (str[i] != 'z') {
      must_greater = i;
      break;
    }
  }
  if (must_greater == -1) {
    puts("Impossible");
    exit(0);
  }
  str[must_greater]++;
  for (int i = must_greater + 1; i <= n; i++) str[i] = 'a';
  if (!dfs(1, false))
    puts("Impossible");
  else {
    for (int i = 1; i <= n; i++) putchar(change[i]);
    putchar('\n');
  }
  return 0;
}
