#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9 + 7;
const int MAXN = 4e5 + 5;
const unsigned long long P = 31;
int d, n;
char s[MAXN];
unsigned long long pw[MAXN], hl[MAXN], hr[MAXN];
bool isPal(int l, int r) {
  unsigned long long hshl = (hl[r] - hl[l - 1] * pw[r - l + 1]) * pw[l - 1];
  unsigned long long hshr = hr[r] - hr[l - 1];
  return (hshl == hshr);
}
int main() {
  scanf("%d%s", &d, s + 1);
  n = strlen(s + 1);
  pw[0] = 1;
  for (int i = 1; i < MAXN; i++) pw[i] = pw[i - 1] * P;
  int bad = n;
  for (int i = 1; i <= n; i++) {
    hl[i] = hl[i - 1] * P + s[i];
    hr[i] = hr[i - 1] + s[i] * pw[i - 1];
    if (i >= d && isPal(i - d + 1, i)) {
      bad = i;
      break;
    }
    if (i >= d + 1 && isPal(i - d, i)) {
      bad = i;
      break;
    }
  }
  bool ok = false;
  for (int i = bad; i; i--) {
    for (int c = s[i] + 1; c <= 'z'; c++) {
      s[i] = c;
      hl[i] = hl[i - 1] * P + s[i];
      hr[i] = hr[i - 1] + s[i] * pw[i - 1];
      if (i >= d && isPal(i - d + 1, i)) continue;
      if (i >= d + 1 && isPal(i - d, i)) continue;
      ok = true;
      break;
    }
    if (ok) {
      bad = i;
      break;
    }
  }
  if (!ok) {
    puts("Impossible");
    return 0;
  }
  for (int i = bad + 1; i <= n; i++) {
    for (int c = 'a'; c <= 'z'; c++) {
      s[i] = c;
      hl[i] = hl[i - 1] * P + s[i];
      hr[i] = hr[i - 1] + s[i] * pw[i - 1];
      if (i >= d && isPal(i - d + 1, i)) continue;
      if (i >= d + 1 && isPal(i - d, i)) continue;
      break;
    }
  }
  printf("%s\n", s + 1);
  return 0;
}
