#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline void Read(T &x) {
  int f = 1;
  char t = getchar();
  while (t < '0' || t > '9') {
    if (t == '-') f = -1;
    t = getchar();
  }
  x = 0;
  while (t >= '0' && t <= '9') {
    x = x * 10 + t - '0';
    t = getchar();
  }
  x *= f;
}
template <typename T>
inline void Write(T x) {
  static int output[20];
  int top = 0;
  if (x < 0) putchar('-'), x = -x;
  do {
    output[++top] = x % 10;
    x /= 10;
  } while (x > 0);
  while (top > 0) putchar('0' + output[top--]);
  putchar('\n');
}
template <typename T>
inline void chkmin(T &x, T y) {
  if (x > y) x = y;
}
template <typename T>
inline void chkmax(T &x, T y) {
  if (x < y) x = y;
}
const int maxn = 400005;
int d;
int n;
char str[maxn];
char ans[maxn];
bool flag[maxn];
namespace PAM {
struct node {
  int fa;
  int val;
  int c[26];
  node() {}
  node(int val) : val(val) { memset(c, 0, sizeof(c)), fa = 0; }
};
int sz;
int last;
node T[maxn];
void init() {
  T[0] = node(0);
  T[1] = node(-1);
  T[0].fa = 1;
  last = 0;
  sz = 1;
}
int newnode(int val) {
  T[++sz] = node(val);
  return sz;
}
void insert(int id, char *str) {
  int p = last;
  int x = str[id] - 'a';
  while (str[id - T[p].val - 1] != str[id]) p = T[p].fa;
  if (!T[p].c[x]) {
    int np = newnode(T[p].val + 2);
    int r = T[p].fa;
    while (str[id - T[r].val - 1] != str[id]) r = T[r].fa;
    T[np].fa = T[r].c[x];
    T[p].c[x] = np;
  }
  last = T[p].c[x];
}
bool check(int pos, int x) {
  for (int i = last; T[i].val + 2 >= d; i = T[i].fa) {
    if (ans[pos - T[i].val - 1] == x) {
      return false;
    }
  }
  return true;
}
};  // namespace PAM
void input() {
  Read(d);
  scanf("%s", str + 1);
  n = strlen(str + 1);
}
void rebuild(int l, int r) {
  PAM::init();
  for (int i = l; i <= r; i++) {
    PAM::insert(i, ans);
  }
}
void prepare() { PAM::init(); }
void solve() {
  if (d == 1) {
    printf("Impossible\n");
    return;
  }
  bool mark = false;
  for (int i = 1; i <= n; i++) {
    int cur = mark ? 'a' : (i == n ? (str[i] + 1) : str[i]);
    while (!PAM::check(i, cur) && cur <= 'z') cur++;
    if (cur > 'z') {
      int pos = -1;
      for (int j = i - 1; j >= 1; j--) {
        if (flag[j]) {
          pos = j;
          break;
        }
      }
      if (pos == -1) {
        printf("Impossible\n");
        return;
      } else {
        ans[pos]++;
        rebuild(1, pos);
        i = pos;
        mark = true;
      }
    } else {
      ans[i] = cur;
      if (cur < 'z') flag[i] = PAM::check(i, cur + 1);
      PAM::insert(i, ans);
      mark |= (cur > str[i]);
    }
  }
  printf("%s\n", ans + 1);
}
int main() {
  input();
  prepare();
  solve();
  return 0;
}
