#include <bits/stdc++.h>
using namespace std;
const unsigned long long seed = 131;
int d, n;
char s[400011], ss[400011];
unsigned long long sk[400011], _hl[400011], _hr[400011], *hl = _hl + 1,
                                                         *hr = _hr + 1;
bool dfs(int k, bool flag) {
  if (k == n) {
    if (!flag) puts(ss);
    return !flag;
  }
  for (char c = flag ? s[k] : 'a'; c <= 'z'; ++c) {
    hl[k] = hl[k - 1] * sk[1] + c;
    hr[k] = hr[k - 1] + c * sk[k];
    if (k - d >= -1 &&
        hl[k] * sk[k - d + 1] - hl[k - d] * sk[k + 1] == hr[k] - hr[k - d])
      continue;
    if (k - d > -1 &&
        hl[k] * sk[k - d] - hl[k - d - 1] * sk[k + 1] == hr[k] - hr[k - d - 1])
      continue;
    ss[k] = c;
    if (dfs(k + 1, flag && c == s[k])) return 1;
  }
  return 0;
}
int main() {
  scanf("%d", &d);
  scanf("%s", s);
  n = strlen(s);
  sk[0] = 1;
  for (int i = 1; i <= n; ++i) sk[i] = sk[i - 1] * seed;
  if (!dfs(0, 1)) puts("Impossible");
  return 0;
}
