#include <bits/stdc++.h>
using namespace std;
const int N = 400001;
const int H = 177;
string s, r;
unsigned long long prod[N + 101] = {};
unsigned long long alseaera_hash[N] = {};
unsigned long long rhash[N] = {};
bool check(int e, int d) {
  e++;
  int start = e - d + 1;
  if (start < 0) return true;
  if ((rhash[e] - rhash[start - 1] * prod[d]) * prod[start - 1] !=
      alseaera_hash[e] - alseaera_hash[start - 1])
    return true;
  return false;
}
int d;
bool dfs(int x, bool t) {
  if (x == s.size()) {
    cout << r << endl;
    return true;
  }
  r[x] = t ? s[x] : 'a';
  while (r[x] <= 'z') {
    alseaera_hash[x + 1] = alseaera_hash[x] + r[x] * prod[x];
    rhash[x + 1] = rhash[x] * H + r[x];
    if (check(x, d) && check(x, d + 1) && dfs(x + 1, t && (r[x] == s[x]))) {
      return true;
    }
    r[x]++;
  }
  return false;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> d >> s;
  r = s;
  int i;
  for (i = s.size() - 1; i >= 0 && s[i] == 'z'; i--) s[i] = 'a';
  if (i < 0) {
    cout << "Impossible" << endl;
    return 0;
  }
  s[i]++;
  prod[0] = 1;
  for (int i = 1; i <= s.size() + 100; i++) {
    prod[i] = H * prod[i - 1];
  }
  if (!dfs(0, 1)) {
    cout << "Impossible" << endl;
  }
  return 0;
}
