#include <bits/stdc++.h>
using namespace std;
const int N = 400001;
const int H = 177;
int d;
int n;
unsigned long long prod[N + 101] = {};
unsigned long long alseaera_hash[N] = {};
unsigned long long rhash[N] = {};
inline bool ispal(int a, int b) {
  return (rhash[b] - rhash[a - 1] * prod[b - a + 1]) * prod[a - 1] ==
         (alseaera_hash[b] - alseaera_hash[a - 1]);
}
string s;
void init() {
  prod[0] = 1;
  for (int i = 1; i <= n + 100; i++) {
    prod[i] = H * prod[i - 1];
  }
  for (int i = 1; i <= n; i++) {
    alseaera_hash[i] = alseaera_hash[i - 1] + s[i] * prod[i - 1];
    rhash[i] = rhash[i - 1] * H + s[i];
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> d >> s;
  n = s.size();
  s = " " + s;
  init();
  int bad = n;
  for (int i = 1; i <= n; i++) {
    if ((i >= d && ispal(i - d + 1, i)) || (i >= d + 1 && ispal(i - d, i))) {
      bad = i;
      break;
    }
  }
  bool flag = false;
  for (int i = bad; i >= 1; i--) {
    for (char c = s[i] + 1; c <= 'z'; c++) {
      s[i] = c;
      alseaera_hash[i] = alseaera_hash[i - 1] + s[i] * prod[i - 1];
      rhash[i] = rhash[i - 1] * H + s[i];
      if ((i >= d && ispal(i - d + 1, i)) || (i >= d + 1 && ispal(i - d, i)))
        continue;
      flag = true;
      bad = i;
      break;
    }
    if (flag) break;
  }
  if (!flag) {
    cout << "Impossible" << endl;
    return 0;
  }
  for (int i = bad + 1; i <= n; i++) {
    for (char c = 'a'; c <= 'z'; c++) {
      s[i] = c;
      alseaera_hash[i] = alseaera_hash[i - 1] + s[i] * prod[i - 1];
      rhash[i] = rhash[i - 1] * H + s[i];
      if ((i >= d && ispal(i - d + 1, i)) || (i >= d + 1 && ispal(i - d, i)))
        continue;
      break;
    }
  }
  s.erase(0, 1);
  cout << s << endl;
  return 0;
}
