#include <bits/stdc++.h>
using namespace std;
long long fpm(long long b, long long e, long long m) {
  long long t = 1;
  for (; e; e >>= 1, b = b * b % m) e & 1 ? t = t * b % m : 0;
  return t;
}
template <class T>
inline bool chkmin(T &a, T b) {
  return a > b ? a = b, true : false;
}
template <class T>
inline bool chkmax(T &a, T b) {
  return a < b ? a = b, true : false;
}
template <class T>
inline T sqr(T x) {
  return x * x;
}
template <class edge>
struct Graph {
  vector<vector<edge> > adj;
  Graph(int n) {
    adj.clear();
    adj.resize(n + 5);
  }
  Graph() { adj.clear(); }
  void resize(int n) { adj.resize(n + 5); }
  void add(int s, edge e) { adj[s].push_back(e); }
  void del(int s, edge e) { adj[s].erase(find(iter(adj[s]), e)); }
  int deg(int v) { return adj[v].size(); }
  vector<edge> &operator[](int t) { return adj[t]; }
};
const int maxn = 440000, prime = 10007;
unsigned long long P[maxn + 1], Hl[maxn], Hr[maxn];
string S, T;
int D;
bool check(int L, int R) {
  unsigned long long hlr = (Hl[R + 1] - Hl[L]) * P[maxn - L];
  unsigned long long hrl = (Hr[R + 1] - Hr[L] * P[R - L + 1]) * P[maxn];
  return hlr == hrl;
}
bool search(int d, bool b) {
  if ((d > D && check(d - D - 1, d - 1)) || (d >= D && check(d - D, d - 1)))
    return false;
  if (d == (int)((S).size())) return b;
  for (int c = b ? 'a' : S[d]; c <= 'z'; ++c) {
    Hl[d + 1] = Hl[d] + c * P[d];
    Hr[d + 1] = Hr[d] * P[1] + c;
    T[d] = c;
    if (search(d + 1, b || c != S[d])) return true;
  }
  return false;
}
int main() {
  ios_base::sync_with_stdio(false);
  P[0] = 1;
  for (int i = 1; i <= maxn; ++i) P[i] = P[i - 1] * prime;
  cin >> D >> S;
  T = S;
  if (search(0, 0))
    cout << T << endl;
  else
    cout << "Impossible" << endl;
  return 0;
}
