#include <bits/stdc++.h>
using std::cin;
using std::cout;
using std::endl;
using std::max;
using std::min;
using std::pair;
using std::priority_queue;
using std::queue;
using std::set;
using std::sort;
using std::vector;
const int maxN = 400000 + 233;
int n, d;
char s[maxN];
unsigned long long B = 123456789123456789ULL;
unsigned long long w[maxN];
unsigned long long h[maxN], rh[maxN];
bool isp(int l, int r) {
  if (l < 1) return false;
  unsigned long long x = (h[r] - h[l - 1] * w[r - l + 1]) * w[l - 1];
  unsigned long long y = rh[r] - rh[l - 1];
  return x == y;
}
void no_solution() {
  printf("Impossible\n");
  exit(0);
}
int increase(int x) {
  while (s[x] == 'z') {
    s[x] = 'a';
    --x;
  }
  if (!x) no_solution();
  ++s[x];
  return x;
}
void solve() {
  increase(n);
  w[0] = 1;
  for (int i = 1; i <= n + 5; ++i) w[i] = w[i - 1] * B;
  h[0] = rh[0] = 0;
  int front = maxN;
  for (int i = 1; i <= n; ++i) {
    if (i > front) s[i] = 'a';
    h[i] = h[i - 1] * B + s[i];
    rh[i] = rh[i - 1] + s[i] * w[i - 1];
    if (isp(i - d, i)) {
      front = increase(i);
      i = front - 1;
    } else if (isp(i - d + 1, i)) {
      front = increase(i);
      i = front - 1;
    }
  }
}
int main() {
  scanf("%d", &d);
  memset(s, 0, sizeof(s));
  scanf("%s", s + 1);
  n = strlen(s + 1);
  solve();
  printf("%s\n", s + 1);
  return 0;
}
