#include <bits/stdc++.h>
using namespace std;
const unsigned long long base = 10007;
unsigned long long pre[400010], h1[400010], h2[400010];
int d, n;
char s[400010];
bool check(int l, int r) {
  return (h1[r] - h1[l - 1] * pre[r - l + 1]) * pre[l - 1] ==
         (h2[r] - h2[l - 1]);
}
int main() {
  pre[0] = 1;
  for (int i = 1; i <= 400000; i++) pre[i] = pre[i - 1] * base;
  scanf("%d", &d);
  getchar();
  scanf("%s", s + 1);
  n = strlen(s + 1);
  int k = n;
  h1[0] = h2[0] = 0;
  for (int i = 1; i <= n; i++) {
    h1[i] = h1[i - 1] * base + s[i] - 'a';
    h2[i] = h2[i - 1] + pre[i - 1] * (s[i] - 'a');
    if (i >= d && check(i - d + 1, i)) {
      k = i;
      break;
    }
    if (i >= d + 1 && check(i - d, i)) {
      k = i;
      break;
    }
  }
  bool ty = false;
  int K;
  for (int i = k; i >= 1; i--) {
    for (int c = s[i] - 'a' + 1; c < 26; c++) {
      h1[i] = h1[i - 1] * base + c;
      h2[i] = h2[i - 1] + pre[i - 1] * c;
      if (i >= d && check(i - d + 1, i)) continue;
      if (i >= d + 1 && check(i - d, i)) continue;
      K = i;
      ty = true;
      break;
    }
    if (ty) break;
  }
  if (!ty) return puts("Impossible"), 0;
  for (int i = 1; i <= n; i++) {
    h1[i] = h1[i - 1] * base + s[i] - 'a';
    h2[i] = h2[i - 1] + pre[i - 1] * (s[i] - 'a');
    if (i < K)
      printf("%c", s[i]);
    else
      for (int c = 0; c < 26; c++) {
        if (i == K && c <= s[i] - 'a') continue;
        h1[i] = h1[i - 1] * base + c;
        h2[i] = h2[i - 1] + pre[i - 1] * c;
        if (i >= d && check(i - d + 1, i)) continue;
        if (i >= d + 1 && check(i - d, i)) continue;
        printf("%c", c + 'a');
        break;
      }
  }
}
