#include <bits/stdc++.h>
using namespace std;
const int kMaxL = 1 << 19;
namespace pald_checker {
const unsigned long long kBase = 31;
unsigned long long t[kMaxL], tr[kMaxL], p[kMaxL];
void init() {
  p[0] = 1;
  for (int i = 1; i < kMaxL; ++i) p[i] = kBase * p[i - 1];
}
void update(int idx, unsigned long long delta, unsigned long long v[]) {
  int len = 0;
  while (idx < kMaxL) {
    v[idx] += delta * p[len];
    len += idx & -idx;
    idx += idx & -idx;
  }
}
unsigned long long query(int idx, unsigned long long v[]) {
  int len = 0;
  unsigned long long hash = 0;
  while (idx) {
    hash += v[idx] * p[len];
    len += idx & -idx;
    idx -= idx & -idx;
  }
  return hash;
}
inline unsigned long long query(int left, int right, unsigned long long v[]) {
  return query(right, v) - query(left - 1, v) * p[right - left + 1];
}
inline bool check(int left, int right, int len) {
  return query(left, right, t) == query(len - right + 1, len - left + 1, tr);
}
void str_update(int pos, unsigned long long inc, int len) {
  update(pos, inc, t);
  update(len - pos + 1, inc, tr);
}
}  // namespace pald_checker
int main() {
  int d;
  cin >> d;
  string s;
  cin >> s;
  if (count(s.begin(), s.end(), 'z') == s.size() || d == 1) {
    cout << "Impossible" << endl;
    return 0;
  }
  {
    int lst = s.size() - 1;
    while (s[lst] == 'z') {
      s[lst] = 'a';
      --lst;
    }
    ++s[lst];
  }
  pald_checker::init();
  for (int i = 0; i < s.size(); ++i)
    pald_checker::str_update(i + 1, s[i] - 'a', s.size());
  int pos = -1;
  for (int i = d; pos == -1 && i <= s.size(); ++i) {
    if (pald_checker::check(i - d + 1, i, s.size()) ||
        (i > d && pald_checker::check(i - d, i, s.size())))
      pos = i;
  }
  bool valid = true;
  if (pos != -1) {
    while (pos && (pos > d - 1 &&
                   pald_checker::check(pos - d + 1, pos, s.size())) ||
           (pos > d && pald_checker::check(pos - d, pos, s.size()))) {
      if (s[pos - 1] == 'z') {
        --pos;
        while (pos && s[pos - 1] == 'z') --pos;
        if (!pos) {
          valid = false;
          break;
        }
      }
      pald_checker::str_update(pos, +1, s.size());
      ++s[pos - 1];
    }
    if (valid) {
      for (int i = pos + 1; i <= s.size(); ++i) {
        unsigned long long delta = 'a' - s[i - 1];
        s[i - 1] = 'a';
        pald_checker::str_update(i, delta, s.size());
        while ((i > d - 1 && pald_checker::check(i - d + 1, i, s.size())) ||
               (i > d && pald_checker::check(i - d, i, s.size()))) {
          ++s[i - 1];
          pald_checker::str_update(i, +1, s.size());
        }
      }
    }
  }
  cout << (valid ? s : "Impossible") << endl;
  return 0;
}
