#include <bits/stdc++.h>
using namespace std;
const int base = 13331;
long long hash1[400001], hash2[400001], power[400001];
char ans[400001], s[400001];
int d1, d2, n;
bool search(int i, bool bigger) {
  if (i == n) return bigger;
  char min = (bigger) ? 'a' : s[i];
  for (char ch = min; ch <= 'z'; ch++) {
    hash1[i + 1] = hash1[i] * base + ch;
    hash2[i + 1] = hash2[i] + ch * power[i];
    if (i + 1 >= d1) {
      long long t1 =
          (hash1[i + 1] - hash1[i + 1 - d1] * power[d1]) * power[i + 1 - d1];
      long long t2 = hash2[i + 1] - hash2[i + 1 - d1];
      if (t1 == t2) continue;
    }
    if (i + 1 >= d2) {
      long long t1 =
          (hash1[i + 1] - hash1[i + 1 - d2] * power[d2]) * power[i + 1 - d2];
      long long t2 = hash2[i + 1] - hash2[i + 1 - d2];
      if (t1 == t2) continue;
    }
    ans[i] = ch;
    if (search(i + 1, bigger || (ch > min))) return true;
  }
  return false;
}
int main() {
  scanf("%d", &d1);
  d2 = d1 + 1;
  scanf("%s", s);
  n = strlen(s);
  power[0] = 1;
  for (int i = 0; i < n; i++) power[i + 1] = power[i] * base;
  hash1[0] = hash2[0] = 0;
  ans[n] = '\0';
  if (search(0, false))
    printf("%s\n", ans);
  else
    printf("Impossible\n");
  return 0;
}
