#include <bits/stdc++.h>
using namespace std;
const int md = 1e9 + 7;
int n, m;
string s, ans;
int pw[400005], l[400005], r[400005];
bool chk(int x, int len) {
  x++;
  if (x < len) return false;
  return ((r[x] - r[x - len] * pw[len]) * pw[x - len]) == l[x] - l[x - len];
}
void dfs(int x, int t) {
  if (x == n) {
    cout << ans << endl;
    exit(0);
  }
  ans[x] = (t ? s[x] : 'a');
  for (; ans[x] <= 'z'; ans[x]++) {
    l[x + 1] = l[x] + ans[x] * pw[x];
    r[x + 1] = r[x] * md + ans[x];
    int cc;
    if (ans[x] == s[x] && t)
      cc = 1;
    else
      cc = 0;
    if (!chk(x, m) && !chk(x, m + 1)) dfs(x + 1, cc);
  }
}
int main() {
  cin >> m >> s;
  n = s.size();
  ans = s;
  int i;
  for (i = n - 1; i >= 0 && s[i] == 'z'; i--) s[i] = 'a';
  if (i < 0)
    printf("Impossible\n");
  else {
    s[i]++;
    pw[0] = 1;
    for (int i = 1; i < 400005; i++) pw[i] = pw[i - 1] * md;
    dfs(0, 1);
    printf("Impossible\n");
  }
  return 0;
}
