#include <bits/stdc++.h>
using namespace std;
inline void opting() {
  ios_base::sync_with_stdio(false);
  cout.tie(0);
  cin.tie(0);
}
long long inp() {
  long long x;
  cin >> x;
  return x;
}
void make_unique(vector<long long> &vec, bool sorted = false) {
  if (!sorted) sort((vec).begin(), (vec).end());
  vec.resize(unique((vec).begin(), (vec).end()) - vec.begin());
}
const long long maxn = 4e5 + 10, delta = 998244353, inf = 1e9 + 420, lg = 20;
long long hsh[maxn];
long long l[maxn], r[maxn];
long long p = 133;
int len, n;
char str[maxn], ans[maxn];
bool check(int i, int lx) {
  if (i < lx) return true;
  if (r[i] - r[i - lx] == (l[i] - l[i - lx] * hsh[lx + 1]) * hsh[i - lx + 1])
    return false;
  return true;
}
bool dfs(int i, int no) {
  if (i == len + 1) {
    ans[len + 1] = '\0';
    cout << ans + 1;
    return 1;
  }
  for (ans[i] = (no ? str[i] : 'a'); ans[i] <= 'z'; ++ans[i]) {
    l[i] = l[i - 1] * p + ans[i];
    r[i] = r[i - 1] + ans[i] * hsh[i];
    if (check(i, n) && check(i, n + 1) &&
        dfs(i + 1, no && (ans[i] == str[i]))) {
      return 1;
    }
  }
  return 0;
}
int main() {
  cin >> n;
  scanf("%s", str + 1);
  len = strlen(str + 1);
  int i = len;
  while (i > 0 && str[i] == 'z') {
    str[i] = 'a';
    --i;
  }
  if (i <= 0) {
    printf("Impossible\n");
    return 0;
  }
  str[i]++;
  hsh[1] = 1;
  for (int i = 2; i <= len; ++i) hsh[i] = hsh[i - 1] * p;
  if (!dfs(1, 1)) printf("Impossible\n");
  return 0;
}
