#include <bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/STACK:200000000")
const double EPS = 1E-9;
const int INF = 1000000000;
const long long INF64 = (long long)1E18;
const double PI = 3.1415926535897932384626433832795;
int d, r;
long long *h, *hr, pw[1100000];
string s, res;
char buf[1100000];
bool is_pal(int l, int r) {
  if (l < 0) return false;
  long long val1 = h[r] - h[l - 1] * pw[r - l + 1];
  long long val2 = hr[r] - hr[l - 1];
  val1 *= pw[l];
  return val1 == val2;
}
bool rec(int p, bool gr) {
  if (!gr && p > r) return false;
  if (p == (int)s.size() && gr) return true;
  char lf = 'a';
  if (!gr) lf = s[p];
  for (char ch = lf; ch <= 'z'; ch++) {
    res += ch;
    h[p] = h[p - 1] * 313 + ch;
    hr[p] = hr[p - 1] + ch * pw[p];
    if (is_pal(p - d + 1, p) || is_pal(p - d, p)) {
      res.erase(res.size() - 1);
      continue;
    }
    if (rec(p + 1, gr || ch > s[p])) return true;
    res.erase(res.size() - 1);
  }
  return false;
}
int main() {
  h = new long long[1100000];
  hr = new long long[1100000];
  h[-1] = 0;
  hr[-1] = 0;
  pw[0] = 1;
  for (int i = 1; i < 1100000; i++) pw[i] = pw[i - 1] * 313;
  cin >> d;
  scanf("%s", buf);
  s = buf;
  r = (int)s.size() - 1;
  while (r >= 0 && s[r] == 'z') r--;
  if (r < 0 || d == 1) {
    puts("Impossible");
    return 0;
  }
  if (rec(0, false))
    puts(res.c_str());
  else
    puts("Impossible");
  return 0;
}
