#include <bits/stdc++.h>
using namespace std;
const string TASK = "";
vector<int> _V(int a[], int _n) {
  vector<int> _v;
  for (int i = 0; i < _n; i++) _v.push_back(a[i]);
  return _v;
}
vector<long long> _V(long long a[], int _n) {
  vector<long long> _v;
  for (int i = 0; i < _n; i++) _v.push_back(a[i]);
  return _v;
}
vector<string> _V(string a[], int _n) {
  vector<string> _v;
  for (int i = 0; i < _n; i++) _v.push_back(a[i]);
  return _v;
}
inline string _IN() { return TASK + ".in"; }
inline string _OUT() { return TASK + ".out"; }
const int N = 4e5 + 5;
const int mult = 1582713;
int n, bad, d;
string s;
int mt[N], h[N], hr[N];
bool pal(int a, int b) {
  int dir = h[b] * mt[a - 1] - h[a - 1] * mt[b];
  int rev = hr[b] - hr[a - 1];
  return dir == rev;
}
int main() {
  cin >> d >> s;
  n = s.size();
  mt[0] = 1;
  for (int i = 1; i <= n; i++) mt[i] = mt[i - 1] * mult;
  bad = n;
  for (int i = 1; i <= n; i++) {
    h[i] = h[i - 1] * mult + s[i - 1];
    hr[i] = hr[i - 1] + mt[i - 1] * s[i - 1];
    if (i >= d && pal(i - d + 1, i)) {
      bad = i;
      break;
    }
    if (i >= d + 1 && pal(i - d, i)) {
      bad = i;
      break;
    }
  }
  bool ok = false;
  while (bad) {
    for (char c = s[bad - 1] + 1; c <= 'z'; c++) {
      s[bad - 1] = c;
      h[bad] = h[bad - 1] * mult + c;
      hr[bad] = hr[bad - 1] + mt[bad - 1] * c;
      if (bad >= d && pal(bad - d + 1, bad)) continue;
      if (bad >= d + 1 && pal(bad - d, bad)) continue;
      ok = true;
      break;
    }
    if (ok) break;
    bad--;
  }
  if (!ok)
    puts("Impossible");
  else {
    bad++;
    while (bad <= n) {
      for (char c = 'a'; c <= 'z'; c++) {
        s[bad - 1] = c;
        h[bad] = h[bad - 1] * mult + c;
        hr[bad] = hr[bad - 1] + mt[bad - 1] * c;
        if (bad >= d && pal(bad - d + 1, bad)) continue;
        if (bad >= d + 1 && pal(bad - d, bad)) continue;
        break;
      }
      bad++;
    }
    puts(s.c_str());
  }
  return 0;
}
