#include <bits/stdc++.h>
using namespace std;
const long long N = 4e5 + 10;
const long long P = 1e9 + 7;
long long d, len;
string s, t;
long long lhash[N], rhash[N], p[N];
long long base = 17971;
long long lget(long long x, long long y) {
  return (lhash[x] - lhash[x - y] * p[y + 1] % P + P) % P;
}
long long rget(long long x, long long y) {
  return (rhash[x] - rhash[x - y] + P) % P;
}
long long check(long long x) {
  if (x >= d && lget(x, d) * p[x - d + 1] % P == rget(x, d)) return 1;
  if (x > d && lget(x, d + 1) * p[x - d] % P == rget(x, d + 1)) return 1;
  return 0;
}
long long dfs(long long x, long long sta) {
  if (x > len) return 1;
  char c;
  if (sta)
    c = s[x];
  else
    c = 'a';
  for (char i = c; i <= 'z'; ++i) {
    t[x] = i;
    lhash[x] = (lhash[x - 1] * base % P + (i - 'a' + 1)) % P;
    rhash[x] = (rhash[x - 1] + p[x] * (i - 'a' + 1) % P) % P;
    if (check(x)) continue;
    if (dfs(x + 1, sta && t[x] == s[x])) return 1;
  }
  return 0;
}
void read_input() {
  cin >> d >> s;
  s = "." + s;
  for (int i = 0; i < s.size(); i++) t += '.';
}
void solve() {
  len = s.size() - 1;
  for (long long i = len; i >= 1; --i) {
    if (s[i] == 'z')
      s[i] = 'a';
    else {
      s[i]++;
      break;
    }
    if (i == 1) {
      cout << "Impossible" << endl;
      exit(0);
    }
  }
  p[1] = 1;
  for (long long i = 2; i <= len; ++i) p[i] = p[i - 1] * base % P;
}
void write_output() {
  if (dfs(1, 1))
    cout << t.substr(1, t.size() - 1) << '\n';
  else
    cout << "Impossible\n";
}
int main() {
  ios ::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  read_input(), solve(), write_output();
  return 0;
}
