#include <bits/stdc++.h>
using namespace std;
struct AnsType {
  int len;
  long long hash0, hash1;
};
struct Node {
  int left, right, mid;
  AnsType data;
  Node *lc, *rc;
};
long long Pow[400001];
const int H = 177;
AnsType operator+(AnsType a, AnsType b) {
  AnsType ans;
  ans.len = a.len + b.len;
  ans.hash0 = a.hash0 * Pow[b.len] + b.hash0;
  ans.hash1 = b.hash1 * Pow[a.len] + a.hash1;
  return ans;
}
int d, N = 0;
bool flag = false;
string s, r;
Node* root;
Node* build(int L, int R) {
  Node* p = new Node{L, R, (L + R) / 2, {R - L + 1}};
  if (L < R) {
    p->lc = build(L, p->mid);
    p->rc = build(p->mid + 1, R);
  }
  return p;
}
void modify(Node* p, int x, int t) {
  if (p->left == p->right) {
    p->data.hash0 = p->data.hash1 = t;
    return;
  }
  modify((x <= p->mid) ? p->lc : p->rc, x, t);
  p->data = p->lc->data + p->rc->data;
}
AnsType get(Node* p, int l, int r) {
  if (p->left == l && p->right == r) return p->data;
  if (r <= p->mid) return get(p->lc, l, r);
  if (l > p->mid) return get(p->rc, l, r);
  return get(p->lc, l, p->mid) + get(p->rc, p->mid + 1, r);
}
void dfs(int dep, bool f) {
  if (dep == N) {
    flag = f;
    return;
  }
  for (char c = f ? 'a' : s[dep]; !flag && c <= 'z'; c++) {
    modify(root, dep, c);
    r[dep] = c;
    if (dep >= d - 1) {
      AnsType T = get(root, dep - d + 1, dep);
      if (T.hash0 == T.hash1) continue;
    }
    if (dep >= d) {
      AnsType T = get(root, dep - d, dep);
      if (T.hash0 == T.hash1) continue;
    }
    dfs(dep + 1, f || (c > s[dep]));
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> d;
  cin >> s;
  N = s.size();
  r = s;
  Pow[0] = 1;
  for (int i = 0; i < N; i++) Pow[i + 1] = Pow[i] * H;
  root = build(0, N - 1);
  dfs(0, 0);
  if (!flag) {
    cout << "Impossible" << endl;
  } else {
    cout << r << endl;
  }
  return 0;
}
