#include <bits/stdc++.h>
unsigned long long int p[1000000], arr[1000000];
int len, s[1000000];
char str[500000];
void pre() {
  p[0] = 1;
  for (int i = 1; i <= 2 * len; i++) p[i] = p[i - 1] * 31;
}
inline int lowbit(int x) { return x & (-x); }
void insert(int pos, unsigned long long int add) {
  for (int i = pos; i <= 2 * len; i += lowbit(i)) arr[i] += add;
}
unsigned long long int query(int pos) {
  unsigned long long int re = 0;
  for (int i = pos; i > 0; i -= lowbit(i)) re += arr[i];
  return re;
}
bool palind(int l, int r) {
  if (l <= 0 || r > len) return false;
  unsigned long long int a = (query(r) - query(l - 1));
  unsigned long long int b = (query(2 * len - l + 1) - query(2 * len - r));
  a *= p[2 * len - r + 1 - l];
  return (a == b) ? true : false;
}
int main() {
  int d, i, pos;
  scanf("%d", &d);
  d--;
  scanf("%s", str);
  for (i = 0; str[i] != '\0'; i++) s[i + 1] = str[i] - 'a';
  len = i;
  pre();
  for (i = 1; i <= len; i++) s[2 * len - i + 1] = s[i];
  for (i = 1; i <= len * 2; i++) insert(i, s[i] * p[i]);
  for (i = 1; i <= len; i++) {
    if (palind(i, i + d)) {
      pos = i + d;
      break;
    }
    if (i + d + 1 <= len && palind(i, i + d + 1)) {
      pos = i + d + 1;
      break;
    }
  }
  if (i == len + 1) pos = len;
  do {
    while (s[pos] == 25 && pos != 1) pos--;
    if (s[pos] == 25 && pos == 1) {
      printf("Impossible\n");
      return 0;
    }
    s[pos]++;
    insert(pos, p[pos]);
    insert(2 * len - pos + 1, p[2 * len - pos + 1]);
  } while (palind(pos - d, pos) || palind(pos - d - 1, pos));
  for (pos++; pos <= len; pos++) {
    insert(pos, -p[pos] * s[pos]);
    insert(2 * len - pos + 1, -p[2 * len - pos + 1] * s[pos]);
    for (s[pos] = 0; palind(pos - d, pos) || palind(pos - d - 1, pos);
         s[pos]++) {
      insert(pos, p[pos]);
      insert(2 * len - pos + 1, p[2 * len - pos + 1]);
    }
  }
  for (i = 1; i <= len; i++) str[i - 1] = s[i] + 'a';
  printf("%s\n", str);
}
