#include <bits/stdc++.h>
using namespace std;
const int N = 404040, seed = 131;
int n, d;
char s[N], t[N];
unsigned long long ba[N], ha[N], rha[N];
bool che(int l, int r) {
  if (l < 0) return 1;
  unsigned long long a, b;
  if (l) {
    a = (ha[r] - ha[l - 1] * ba[r - l + 1]) * ba[l];
    b = rha[r] - rha[l - 1];
  } else {
    a = ha[r];
    b = rha[r];
  }
  return a != b;
}
bool dfs(int p, int lim) {
  if (p == n) {
    puts(t);
    return 1;
  }
  for (t[p] = (lim ? s[p] : 'a'); t[p] <= 'z'; ++t[p]) {
    if (p) {
      ha[p] = ha[p - 1] * seed + t[p];
      rha[p] = rha[p - 1] + t[p] * ba[p];
    } else {
      ha[p] = t[p];
      rha[p] = t[p];
    }
    if (che(p - d + 1, p) && che(p - d, p) && dfs(p + 1, lim && (t[p] == s[p])))
      return 1;
  }
  return 0;
}
int main() {
  while (~scanf("%d%s", &d, s)) {
    n = strlen(s);
    bool find = 0;
    for (int i = n - 1; ~i; --i)
      if (s[i] != 'z') {
        ++s[i];
        find = 1;
        for (int j = (i + 1); j < (n); j++) s[j] = 'a';
        break;
      }
    if (!find) {
      puts("Impossible");
      continue;
    }
    ba[0] = 1;
    for (int i = (1); i < (n); i++) ba[i] = ba[i - 1] * seed;
    if (!dfs(0, 1)) puts("Impossible");
  }
  return 0;
}
