In problems on strings one often has to find a string with some particular properties. The problem authors were reluctant to waste time on thinking of a name for some string so they called it good. A string is good if it doesn't have palindrome substrings longer than or equal to d. You are given string s, consisting only of lowercase English letters. Find a good string t with length |s|, consisting of lowercase English letters, which is lexicographically larger than s. Of all such strings string t must be lexicographically minimum.We will call a non-empty string s[a ... b] = sasa + 1... sb (1 ≤ a ≤ b ≤ |s|) a substring of string s = s1s2... s|s|.A non-empty string s = s1s2... sn is called a palindrome if for all i from 1 to n the following fulfills: si = sn - i + 1. In other words, palindrome read the same in both directions.String x = x1x2... x|x| is lexicographically larger than string y = y1y2... y|y|, if either |x| > |y| and x1 = y1, x2 = y2, ... , x|y| = y|y|, or there exists such number r (r < |x|, r < |y|), that x1 = y1, x2 = y2, ... , xr = yr and xr + 1 > yr + 1. Characters in such strings are compared like their ASCII codes.

The first line contains integer d (1 ≤ d ≤ |s|). The second line contains a non-empty string s, its length is no more than 4·105 characters. The string consists of lowercase English letters.

Print the good string that lexicographically follows s, has the same length and consists of only lowercase English letters. If such string does not exist, print "Impossible" (without the quotes).

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;

public class Main {

	public static void main(String[] args) {
		try {
			BufferedReader questionreader = new BufferedReader(new InputStreamReader(System.in));
			PrintWriter answerwriter = new PrintWriter(System.out);

			int D = Integer.parseInt(questionreader.readLine());
			char[] S = questionreader.readLine().toCharArray();

			answerwriter.println(analyze(D, S));

			answerwriter.close();
			questionreader.close();

		} catch (FileNotFoundException e) {
			e.printStackTrace();
			return;
		} catch (IOException e) {
			e.printStackTrace();
			return;
		}
	}

	public static int[] l = null;
	public static int[] n = null;
	public static int[] u = null;

	public static String analyze(final int D, final char[] S) {
		S[S.length-1]++;
		int i = S.length-1;
		while (S[i] > 'z') {
			if (i == 0) return "Impossible";
			S[i] = 'a';
			S[--i]++;
		}
		l = new int[S.length+1];
		n = new int[S.length+1];
		u = new int[S.length+1];
		int[] t = new int[S.length+1];
		t[0] = D-1;
		i = 0;
		while (i < S.length) {
			if (S[i] == '0') {
				S[i] = 'a';
				if (i+1 < S.length) S[i+1] = '0';
			}
			u[i+1] = u[i]+S[i];
			if (i>0 && S[i]==S[i-1]) {
				l[i]=l[i-1]; n[l[i]]++;
			} else {
				l[i]=0; n[l[i]]=0;
			}

			if (i >= t[i]) {
				if (check(i-D, i, S) || check(i-D+1, i, S)) {
					n[l[i]]++;
					if (i+1 < S.length) S[i+1] = '0';
					S[i]++;
					while (S[i] > 'z') {
						if (i == 0) return "Impossible";
						S[i] = '0';
						S[--i]++;
					}
					continue;
				}
			}
			int j = i;
			i++;
			t[i] = Math.max(i, t[i-1]);
			int k = j-D+1+(t[i]-j)*2;
			while (t[i] < S.length && k < j) {
				if (k < 0) { t[i]++; k+=2; continue; }
				if (k == 0) {
					if (S[j]!=S[k]) { t[i]++; k+=2; continue; }
				} else {
					if (S[j]!=S[k] && S[j]!=S[k-1]) { t[i]++; k+=2; continue; }
				}
				break;
			}
		}
		return String.valueOf(S);
	}

	public static boolean check(int p, int q, char[] S) {
		if (p < 0) return false;
		int m = (q-p)/2;
		if (u[q+1]-u[q-m] != u[p+m+1]-u[p]) return false;
		while (S[p]==S[q]) {
			m = Math.min(n[l[p]],n[l[q]])+1;
			p+=m;
			q-=m;
			if (p>q) return true;
		}
		return false;
	}
}

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;

public class Main {

	public static void main(String[] args) {
		try {
			BufferedReader questionreader = new BufferedReader(new InputStreamReader(System.in));
			PrintWriter answerwriter = new PrintWriter(System.out);

			int D = Integer.parseInt(questionreader.readLine());
			char[] S = questionreader.readLine().toCharArray();

			answerwriter.println(analyze(D, S));

			answerwriter.close();
			questionreader.close();

		} catch (FileNotFoundException e) {
			e.printStackTrace();
			return;
		} catch (IOException e) {
			e.printStackTrace();
			return;
		}
	}

	public static int[] l = null;
	public static int[] n = null;
	public static int[] o = null;
	public static int[] u = null;

	public static String analyze(final int D, final char[] S) {
		S[S.length-1]++;
		int i = S.length-1;
		while (S[i] > 'z') {
			if (i == 0) return "Impossible";
			S[i] = 'a';
			S[--i]++;
		}
		l = new int[S.length+1];
		n = new int[S.length+1];
		o = new int[S.length+1];
		u = new int[S.length+1];
		int[] t = new int[S.length+1];
		t[0] = D-1;
		i = 0;
		while (i < S.length) {
			if (S[i] == '0') {
				S[i] = 'a';
				if (i+1 < S.length) S[i+1] = '0';
			}
			u[i+1] = u[i]+S[i];
			if (i>0) {
				if (S[i]==S[i-1]) { l[i]=l[i-1]; n[l[i]]++; o[i]=o[i-1]+1; }
				else { l[i]=l[i-1]+1; n[l[i]]=0; o[i]=0; }
			} else { l[i]=0; n[l[i]]=0; o[i]=0; }

			if (i >= t[i]) {
				if (check(i-D, i, S) || check(i-D+1, i, S)) {
					n[l[i]]--;
					if (i+1 < S.length) S[i+1] = '0';
					S[i]++;
					while (S[i] > 'z') {
						if (i == 0) return "Impossible";
						S[i] = '0';
						S[--i]++;
					}
					continue;
				}
			}
			int j = i;
			i++;
			t[i] = Math.max(i, t[i-1]);
			int k = j-D+1+(t[i]-j)*2;
			while (t[i] < S.length && k < j) {
				if (k < 0) { t[i]++; k+=2; continue; }
				if (k == 0) {
					if (S[j]!=S[k]) { t[i]++; k+=2; continue; }
				} else {
					if (S[j]!=S[k] && S[j]!=S[k-1]) { t[i]++; k+=2; continue; }
				}
				break;
			}
		}
		return String.valueOf(S);
	}

	public static boolean check(int p, int q, char[] S) {
		if (p < 0) return false;
		int m = (q-p)/2;
		if (u[q+1]-u[q-m] != u[p+m+1]-u[p]) return false;
		while (S[p]==S[q]) {
			m = Math.min(n[l[p]]-o[p],o[q])+1;
			p+=m;
			q-=m;
			if (p>q) return true;
		}
		return false;
	}
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;

public class TaskD implements Runnable {

	char str[];
	int most, n;
	final int MOD = 1000000003, MUL = 37;
	int hash[], rhash[];
	long power[];

	private long key(int l, int r)
	{
		long ret = (hash[r + 1] - hash[l] * power[r - l + 1]) % MOD;
		if (ret < 0) ret += MOD;
		return ret;
	}

	private long rkey(int l, int r)
	{
		long ret = (rhash[r + 1] - rhash[l]) % MOD;
		if (ret < 0) ret += MOD;
		return ret;
	}

	private boolean par(int l, int r)
	{
		if (l < 0) return false;

		int mid = (l + r) >> 1, len = r - l + 1;
		if (len % 2 == 1)
			return key(l, mid) * power[mid] % MOD == rkey(mid, r);
		return key(l, mid) * power[mid+1]  % MOD== rkey(mid+1, r);
	}

    private void solve() throws IOException {
    	most = nextInt();
    	String s = nextToken();
    	str = s.toCharArray();
    	n = s.length();

    	hash = new int[n + 1];
    	rhash = new int[n + 1];
    	power = new long[n + 1];

    	hash[0] = 0;
    	rhash[0] = 0;
    	power[0] = 1;
    	for (int i = 1; i <= n; ++i)
    		power[i] = power[i-1] * MUL % MOD;

    	int where = n-1;
    	for (int i = 0; i < n; ++i)
    	{
    		hash[i+1] = (int)((hash[i] * (long)MUL + (str[i] - 'a')) % MOD);
    		rhash[i+1] = (int)((rhash[i] + power[i] * (str[i] - 'a')) % MOD);

    		if (par(i - most + 1, i) || par(i - most, i))
    		{
    			where = i;
    			break;
    		}
    	}

    	while (where >= 0)
    	{
    		boolean ok = false;
    		for (char i = (char) (str[where] + 1); !ok && i <= 'z'; ++i)
    		{
    			hash[where+1] = (int)((hash[where] * (long)MUL + (i - 'a')) % MOD);
        		rhash[where+1] = (int)((rhash[where] + power[where] * (i - 'a')) % MOD);
    			str[where] = i;

    			ok = true;
        		if (par(where - most + 1, where) || par(where - most, where))
        			ok = false;
    		}

    		if (ok) break;
    		--where;
    	}

    	if (where < 0)
    	{
    		writer.println("Impossible");
    		return;
    	}

    	for (int p = where+1; p < n; ++p)
    	{
    		for (char i = 'a'; i <= 'z'; ++i)
    		{
    			hash[p+1] = (int)((hash[p] * (long)MUL + (i - 'a')) % MOD);
        		rhash[p+1] = (int)((rhash[p] + power[p] * (i - 'a')) % MOD);
    			str[p] = i;

        		if (!par(p - most + 1, p) && !par(p - most, p))
        			break;
    		}
    	}

    	writer.println(String.valueOf(str));
    }

    public static void main(String[] args) {
        new TaskD().run();
    }

    BufferedReader reader;
    StringTokenizer tokenizer;
    PrintWriter writer;

    public void run() {
        try {
            reader = new BufferedReader(new InputStreamReader(System.in));
            tokenizer = null;
            writer = new PrintWriter(System.out);
            solve();
            reader.close();
            writer.close();
        } catch (Exception e) {
            e.printStackTrace();
            System.exit(1);
        }
    }

    int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }

    long nextLong() throws IOException {
        return Long.parseLong(nextToken());
    }

    double nextDouble() throws IOException {
        return Double.parseDouble(nextToken());
    }

    String nextToken() throws IOException {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            tokenizer = new StringTokenizer(reader.readLine());
        }
        return tokenizer.nextToken();
    }
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;

public class TaskD implements Runnable {

	char str[];
	int most, n;
	final int MOD = 1000000003, MUL = 37;
	int hash[], rhash[];
	long power[];

	private long key(int l, int r)
	{
		long ret = (hash[r + 1] - hash[l] * power[r - l + 1]) % MOD;
		if (ret < 0) ret += MOD;
		return ret;
	}

	private long rkey(int l, int r)
	{
		long ret = (rhash[r + 1] - rhash[l]) % MOD;
		if (ret < 0) ret += MOD;
		return ret;
	}

	private boolean par(int l, int r)
	{
		if (l < 0) return false;

		int mid = (l + r) >> 1, len = r - l + 1;
		if (len % 2 == 1)
			return key(l, mid) * power[mid] % MOD == rkey(mid, r);
		return key(l, mid) * power[mid+1]  % MOD== rkey(mid+1, r);
	}

    private void solve() throws IOException {
    	most = nextInt();
    	String s = nextToken();
    	str = s.toCharArray();
    	n = s.length();

    	boolean good = false;
    	for (int i = n-1; i >= 0; --i)
    	{
    		if (str[i] != 'z')
    		{
    			++str[i];
    			for (int j = i+1; j < n; ++j)
    				str[j] = 'a';
    			good = true;
    			break;
    		}
    	}

    	if (!good)
    	{
    		writer.println("Impossible");
    		return;
    	}

    	hash = new int[n + 1];
    	rhash = new int[n + 1];
    	power = new long[n + 1];

    	hash[0] = 0;
    	rhash[0] = 0;
    	power[0] = 1;
    	for (int i = 1; i <= n; ++i)
    		power[i] = power[i-1] * MUL % MOD;

    	int where = n;
    	for (int i = 0; i < n; ++i)
    	{
    		hash[i+1] = (int)((hash[i] * (long)MUL + (str[i] - 'a')) % MOD);
    		rhash[i+1] = (int)((rhash[i] + power[i] * (str[i] - 'a')) % MOD);

    		if (par(i - most + 1, i) || par(i - most, i))
    		{
    			where = i;
    			break;
    		}
    	}

    	if (n == where)
    	{
    		writer.println(String.valueOf(str));
    		return;
    	}

    	while (where >= 0)
    	{
    		boolean ok = false;
    		for (char i = (char) (str[where] + 1); !ok && i <= 'z'; ++i)
    		{
    			hash[where+1] = (int)((hash[where] * (long)MUL + (i - 'a')) % MOD);
        		rhash[where+1] = (int)((rhash[where] + power[where] * (i - 'a')) % MOD);
    			str[where] = i;

    			ok = true;
        		if (par(where - most + 1, where) || par(where - most, where))
        			ok = false;
    		}

    		if (ok) break;
    		--where;
    	}

    	if (where < 0)
    	{
    		writer.println("Impossible");
    		return;
    	}

    	for (int p = where+1; p < n; ++p)
    	{
    		for (char i = 'a'; i <= 'z'; ++i)
    		{
    			hash[p+1] = (int)((hash[p] * (long)MUL + (i - 'a')) % MOD);
        		rhash[p+1] = (int)((rhash[p] + power[p] * (i - 'a')) % MOD);
    			str[p] = i;

        		if (!par(p - most + 1, p) && !par(p - most, p))
        			break;
    		}
    	}

    	writer.println(String.valueOf(str));
    }

    public static void main(String[] args) {
        new TaskD().run();
    }

    BufferedReader reader;
    StringTokenizer tokenizer;
    PrintWriter writer;

    public void run() {
        try {
            reader = new BufferedReader(new InputStreamReader(System.in));
            tokenizer = null;
            writer = new PrintWriter(System.out);
            solve();
            reader.close();
            writer.close();
        } catch (Exception e) {
            e.printStackTrace();
            System.exit(1);
        }
    }

    int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }

    long nextLong() throws IOException {
        return Long.parseLong(nextToken());
    }

    double nextDouble() throws IOException {
        return Double.parseDouble(nextToken());
    }

    String nextToken() throws IOException {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            tokenizer = new StringTokenizer(reader.readLine());
        }
        return tokenizer.nextToken();
    }
}

//package prac;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.InputMismatchException;

public class P124D {
	InputStream is;
	PrintWriter out;
	String INPUT = "";

	void solve()
	{
		int d = ni();
		char[] s = ns(400003);
		int n = s.length;

		// 先にインクリメント
		for(int i = n-1;i >= 0;i--){
			s[i]++;
			if(s[i] <= 'z')break;
			if(i == 0){
				out.println("Impossible");
				return;
			}
			s[i] = 'a';
		}

		int H = 31;
		long[] es = new long[n+3];
		es[0] = 1;
		for(int i = 0;i < n+2;i++){
			es[i+1] = es[i] * H;
		}

		long[] hs = new long[n];
		for(int i = 0;i < n;i++){
			hs[i] = es[i] * (s[i]-'a'+1);
		}
		long[] rhs = new long[n];
		for(int i = 0;i < n;i++){
			rhs[i] = es[n-1-i] * (s[i]-'a'+1);
		}

		long[] hft = buildFenwick(hs);
		long[] rhft = buildFenwick(rhs);

		boolean first = true;
		for(int i = d-1;i < n;i++){
			// iが最後になる、制約を破るpalindromeができてしまうかチェック
			if(palin(i, d, n, hft, rhft, es) || palin(i, d+1, n, hft, rhft, es)){
				// できるならiをインクリメント
				s[i]++;
				addFenwick(hft, i, es[i]);
				addFenwick(rhft, i, es[n-1-i]);
				if(first){
					// 初回なら更地に
					for(int j = i+1;j < n;j++){
						addFenwick(hft, j, ('a'-s[j])*es[j]);
						addFenwick(rhft, j, ('a'-s[j])*es[n-1-j]);
						s[j] = 'a';
					}
					first = false;
				}
				while(s[i] > 'z'){
					if(i == 0){
						out.println("Impossible");
						return;
					}
					s[i] = 'a';
					addFenwick(hft, i, -26*es[i]);
					addFenwick(rhft, i, -26*es[n-1-i]);
					i--;
					s[i]++;
					addFenwick(hft, i, es[i]);
					addFenwick(rhft, i, es[n-1-i]);
				}
				i--;
			}
		}
		out.println(new String(s));
	}

	boolean palin(int end, int d, int n, long[] hft, long[] rhft, long[] es)
	{
		if(end-d < -1)return false;
		long first = (sumFenwick(hft, end) - sumFenwick(hft, end-d)) * es[n-1-end];
		long last = (sumFenwick(rhft, end) - sumFenwick(rhft, end-d)) * es[end-d+1];
		return first == last;
	}

	public static long sumFenwick(long[] ft, int i)
	{
		long sum = 0;
		for(i++;i > 0;i -= i&-i)sum += ft[i];
		return sum;
	}

	public static void addFenwick(long[] ft, int i, long v)
	{
		if(v == 0)return;
		int n = ft.length;
		for(i++;i < n;i += i&-i)ft[i] += v;
	}

	public static long[] restoreFenwick(long[] ft)
	{
		int n = ft.length-1;
		long[] ret = new long[n];
		for(int i = 0;i < n;i++)ret[i] = sumFenwick(ft, i);
		for(int i = n-1;i >= 1;i--)ret[i] -= ret[i-1];
		return ret;
	}

	public static long[] buildFenwick(long[] a)
	{
		int n = a.length;
		long[] ft = new long[n+1];
		System.arraycopy(a, 0, ft, 1, n);
		for(int k = 2, h = 1;k <= n;k*=2, h*=2){
			for(int i = k;i <= n;i+=k){
				ft[i] += ft[i-h];
			}
		}
		return ft;
	}

	void run() throws Exception
	{
//		int n = 40, m = 99999;
//		Random gen = new Random();
//		StringBuilder sb = new StringBuilder();
//		sb.append(gen.nextInt(10)+1 + " ");
//		for(int i = 0;i < n;i++){
//			sb.append((char)('y'+gen.nextInt(2)));
//		}
//		INPUT = sb.toString();

		is = oj ? System.in : new ByteArrayInputStream(INPUT.getBytes());
		out = new PrintWriter(System.out);

		long s = System.currentTimeMillis();
		solve();
		out.flush();
		tr(System.currentTimeMillis()-s+"ms");
	}

	public static void main(String[] args) throws Exception { new P124D().run(); }

	private byte[] inbuf = new byte[1024];
	private int lenbuf = 0, ptrbuf = 0;

	private int readByte()
	{
		if(lenbuf == -1)throw new InputMismatchException();
		if(ptrbuf >= lenbuf){
			ptrbuf = 0;
			try { lenbuf = is.read(inbuf); } catch (IOException e) { throw new InputMismatchException(); }
			if(lenbuf <= 0)return -1;
		}
		return inbuf[ptrbuf++];
	}

	private boolean isSpaceChar(int c) { return !(c >= 33 && c <= 126); }
	private int skip() { int b; while((b = readByte()) != -1 && isSpaceChar(b)); return b; }

	private char[] ns(int n)
	{
		char[] buf = new char[n];
		int b = skip(), p = 0;
		while(p < n && !(isSpaceChar(b))){
			buf[p++] = (char)b;
			b = readByte();
		}
		return n == p ? buf : Arrays.copyOf(buf, p);
	}

	private int ni()
	{
		int num = 0, b;
		boolean minus = false;
		while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
		if(b == '-'){
			minus = true;
			b = readByte();
		}

		while(true){
			if(b >= '0' && b <= '9'){
				num = num * 10 + (b - '0');
			}else{
				return minus ? -num : num;
			}
			b = readByte();
		}
	}

	private boolean oj = System.getProperty("ONLINE_JUDGE") != null;
	private void tr(Object... o) { if(!oj)System.out.println(Arrays.deepToString(o)); }
}

import java.io.InputStreamReader;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskD solver = new TaskD();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskD {
    static final long BASE = 31371;

    public void solve(int testNumber, InputReader in, PrintWriter out) {
        int d1 = in.nextInt();
        int d2 = d1 + 1;
        String s = in.next();
        int n = s.length();
        StringBuilder res = new StringBuilder();
        res.append(s);
        long[] hash = new long[n + 1];
        long[] hashRev = new long[n + 1];
        long[] basePow = new long[n + 1];
        basePow[0] = 1;
        for (int i = 0; i < n; ++i)
            basePow[i + 1] = basePow[i] * BASE;
        boolean bigger = false;
        int i = 0;
        while (i < n) {
            char min = res.charAt(i);
            int oldi = i;
            for (char ch = min; ch <= 'z'; ++ch) {
                if (!bigger && ch > min) {
                    bigger = true;
                    for (int ii = i + 1; ii < n; ++ii)
                        res.setCharAt(ii, 'a');
                }
                res.setCharAt(i, ch);
                hash[i + 1] = hash[i] * BASE + ch;
                hashRev[i + 1] = hashRev[i] + ch * basePow[i];
                boolean ok = true;
                if (i + 1 >= d1) {
                    if ((hash[i + 1] - hash[i + 1 - d1] * basePow[d1]) * basePow[i + 1 - d1] == (hashRev[i + 1] - hashRev[i + 1 - d1])) {
                        ok = false;
                    }
                }
                if (i + 1 >= d2) {
                    if ((hash[i + 1] - hash[i + 1 - d2] * basePow[d2]) * basePow[i + 1 - d2] == (hashRev[i + 1] - hashRev[i + 1 - d2])) {
                        ok = false;
                    }
                }
                if (ok && (bigger || i + 1 < n)) {
                    ++i;
                    break;
                }
            }
            if (i == oldi) {
                if (!bigger) {
                    for (int ii = i; ii < n; ++ii) res.setCharAt(ii, 'a');
                }
                res.setCharAt(i, 'a');
                --i;
                while (i >= 0 && res.charAt(i) == 'z') {
                    res.setCharAt(i, 'a');
                    --i;
                }
                if (i < 0) {
                    out.println("Impossible");
                    return;
                }
                res.setCharAt(i, (char) (res.charAt(i) + 1));
                bigger = true;
            }
        }
        out.println(res.toString());
    }
}

class InputReader {
    private BufferedReader reader;
    private StringTokenizer tokenizer;

    public InputReader(InputStream stream) {
        reader = new BufferedReader(new InputStreamReader(stream));
        tokenizer = null;
    }

    public String next() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    }

    public int nextInt() {
        return Integer.parseInt(next());
    }

    }

import java.io.*;
import java.util.*;
import static java.lang.Math.*;

public class StringWithoutPalindromesHashes implements Runnable {

	final boolean ONLINE_JUDGE = System.getProperty("ONLINE_JUDGE") != null;

	BufferedReader in;
	PrintWriter out;
	StringTokenizer tok;

	@Override
	public void run() {
		try {
			long startTime = System.currentTimeMillis();
			if (ONLINE_JUDGE) {
				in = new BufferedReader(new InputStreamReader(System.in));
				out = new PrintWriter(System.out);
			} else {
				in = new BufferedReader(new FileReader("input.txt"));
				out = new PrintWriter("output.txt");
			}
			tok = new StringTokenizer("");
			Locale.setDefault(Locale.US);
			solve();
			in.close();
			out.close();
			long endTime = System.currentTimeMillis();
			long totalMemory = Runtime.getRuntime().totalMemory();
			long freeMemory = Runtime.getRuntime().freeMemory();
			System.err.println("Time = " + (endTime - startTime) + " ms");
			System.err.println("Memory = " + ((totalMemory - freeMemory) / 1024) + " KB");
		} catch (Throwable e) {
			e.printStackTrace(System.err);
			System.exit(-1);
		}
	}

	String readString() throws IOException {
		while (!tok.hasMoreTokens()) {
			tok = new StringTokenizer(in.readLine());
		}
		return tok.nextToken();
	}

	int readInt() throws IOException {
		return Integer.parseInt(readString());
	}

	long readLong() throws IOException {
		return Long.parseLong(readString());
	}

	double readDouble() throws IOException {
		return Double.parseDouble(readString());
	}

	void debug(Object... o) {
		if (!ONLINE_JUDGE) {
			System.err.println(Arrays.deepToString(o));
		}
	}

	public static void main(String[] args) {
		new Thread(null, new StringWithoutPalindromesHashes(), "", 256 * 1024 * 1024).start();
	}

//------------------------------------------------------------------------------

	int d, n;
	char[] s;
	long[] p, h, rh;

	void inc(long[] tree, int pos, long delta) {
		for (int i = pos; i < n; i |= (i + 1)) {
			tree[i] += delta;
		}
	}

	long getSum(long[] tree, int right) {
		long res = 0;
		for (int i = right; i >= 0; i = (i & (i + 1)) - 1) {
			res += tree[i];
		}
		return res;
	}

	long getSum(long[] tree, int left, int right) {
		return getSum(tree, right) - getSum(tree, left - 1);
	}

	boolean isPalindrome(int left, int right) {
		long hash = getSum(h, left, right);
		long revHash = getSum(rh, left, right);
		return hash * p[n - right - 1] == revHash * p[left];
	}

	void setChar(int pos, char ch) {
		int deltaChar = ch - s[pos];
		s[pos] = ch;
		inc(h, pos, deltaChar * p[pos]);
		inc(rh, pos, deltaChar * p[n - pos - 1]);
	}

	void initHashes() {
		p = new long[n];
		h = new long[n];
		rh = new long[n];
		p[0] = 1;
		for (int i = 1; i < n; i++) {
			p[i] = p[i-1] * 161;
		}
		for (int i = 0, j = n-1; i < n; i++, j--) {
			inc(h, i, p[i] * s[i]);
			inc(rh, j, p[i] * s[j]);
		}
	}

	void solve() throws IOException {
		d = readInt();
		s = readString().toCharArray();
		n = s.length;
		initHashes();
		int badPos = n-1;
		for (int i = 0; i < n; i++) {
			if (i+d < n && isPalindrome(i, i+d-1)) {
				badPos = i+d-1;
				break;
			}
			if (i+d+1 < n && isPalindrome(i, i+d)) {
				badPos = i+d;
				break;
			}
		}
		while (true) {
			if (badPos < 0) {
				out.println("Impossible");
				return;
			}
			if (s[badPos] == 'z') {
				badPos--;
				continue;
			}
			setChar(badPos, (char)(s[badPos] + 1));
			if (badPos-d+1 >= 0 && isPalindrome(badPos-d+1, badPos)) {
				continue;
			}
			if (badPos-d >= 0 && isPalindrome(badPos-d, badPos)) {
				continue;
			}
			break;
		}
		for (int i = badPos+1; i < n; i++) {
			setChar(i, 'a');
			while (true) {
				if (i-d+1 >= 0 && isPalindrome(i-d+1,i)) {
					setChar(i, (char)(s[i] + 1));
					continue;
				}
				if (i-d >= 0 && isPalindrome(i-d,i)) {
					setChar(i, (char)(s[i] + 1));
					continue;
				}
				break;
			}
		}
		out.println(new String(s));
	}

}

import java.io.*;
import java.util.*;
import static java.lang.Math.*;

public class StringWithoutPalindromes implements Runnable {

	final boolean ONLINE_JUDGE = System.getProperty("ONLINE_JUDGE") != null;

	BufferedReader in;
	PrintWriter out;
	StringTokenizer tok;

	@Override
	public void run() {
		try {
			long startTime = System.currentTimeMillis();
			if (ONLINE_JUDGE) {
				in = new BufferedReader(new InputStreamReader(System.in));
				out = new PrintWriter(System.out);
			} else {
				in = new BufferedReader(new FileReader("input.txt"));
				out = new PrintWriter("output.txt");
			}
			tok = new StringTokenizer("");
			Locale.setDefault(Locale.US);
			solve();
			in.close();
			out.close();
			long endTime = System.currentTimeMillis();
			long totalMemory = Runtime.getRuntime().totalMemory();
			long freeMemory = Runtime.getRuntime().freeMemory();
			System.err.println("Time = " + (endTime - startTime) + " ms");
			System.err.println("Memory = " + ((totalMemory - freeMemory) / 1024) + " KB");
		} catch (Throwable e) {
			e.printStackTrace(System.err);
			System.exit(-1);
		}
	}

	String readString() throws IOException {
		while (!tok.hasMoreTokens()) {
			tok = new StringTokenizer(in.readLine());
		}
		return tok.nextToken();
	}

	int readInt() throws IOException {
		return Integer.parseInt(readString());
	}

	long readLong() throws IOException {
		return Long.parseLong(readString());
	}

	double readDouble() throws IOException {
		return Double.parseDouble(readString());
	}

	void debug(Object... o) {
		if (!ONLINE_JUDGE) {
			System.err.println(Arrays.deepToString(o));
		}
	}

	public static void main(String[] args) {
		new Thread(null, new StringWithoutPalindromes(), "", 256 * 1024 * 1024).start();
	}

//------------------------------------------------------------------------------

	void solve() throws IOException {
		int d = readInt();
		char[] s = readString().toCharArray();
		int n = s.length;
		if (d == 1) {
			out.println("Impossible");
			return;
		}
		int[] odd = new int[n];
		int[] even = new int[n];
		boolean increased = false;
		int[] oddL = new int[n+1];
		int[] oddR = new int[n+1];
		int[] evenL = new int[n+1];
		int[] evenR = new int[n+1];
		oddR[0] = evenR[0] = -1;
		int startPos = 0;
		aBorder = n;
		while (true) {
			int badPos = n-1;
			boolean good = true;
			int stackPos = -1;
			for (int i = startPos; i < n; i++) {
				int oddK = (i>oddR[i] ? 1 : min(odd[oddL[i]+oddR[i]-i], oddR[i]-i));
				int evenK = (i>evenR[i] ? 0 : min(even[evenL[i]+evenR[i]-i+1], evenR[i]-i+1)) + 1;
				while (i-oddK >= 0 && i+oddK < n && s[i+oddK] == s[i-oddK]) {
					oddK++;
					if (2*oddK-1 >= d) break;
				}
				while (i-evenK >= 0 && i+evenK-1 < n && s[i+evenK-1] == s[i-evenK]) {
					evenK++;
					if (2*(evenK-1) >= d) break;
				}
				odd[i] = oddK--;
				even[i] = --evenK;
				oddL[i+1] = oddL[i];
				oddR[i+1] = oddR[i];
				evenL[i+1] = evenL[i];
				evenR[i+1] = evenR[i];
				if (i+oddK >= oddR[i]) {
					oddL[i+1] = i-oddK;
					oddR[i+1] = i+oddK;
				}
				if (i+evenK-1 >= evenR[i]) {
					evenL[i+1] = i-evenK;
					evenR[i+1] = i+evenK-1;
				}
				int badOddPos = Integer.MAX_VALUE, badEvenPos = Integer.MAX_VALUE;
				if (2*odd[i]-1 >= d) {
					badOddPos = i+odd[i]-1;
					good = false;
				}
				if (2*even[i] >= d) {
					badEvenPos = i+even[i]-1;
					good = false;
				}
				if (!good) {
					badPos = min(badOddPos, badEvenPos);
					stackPos = i+1;
					break;
				}
			}
			if (good && increased) {
				break;
			}
			int leftAffectedPos = inc(s, n, badPos);
			if (leftAffectedPos == -1) {
				out.println("Impossible");
				return;
			}
			increased = true;
			int newStartPos = Integer.MAX_VALUE;
			for (int i = stackPos; i > 0; i--) {
				if (oddR[i] >= leftAffectedPos - 1 || evenR[i] >= leftAffectedPos - 1) {
					newStartPos = min(newStartPos, i-1);
				} else {
					break;
				}
			}
			if (newStartPos != Integer.MAX_VALUE) {
				startPos = newStartPos;
			}
		}
		out.println(new String(s));
	}

	int aBorder;

	private int inc(char[] s, int n, int badPos) {
		while (badPos >= 0 && s[badPos] == 'z') {
			badPos--;
		}
		if (badPos < 0) {
			return -1;
		}
		s[badPos]++;
		for (int i = badPos + 1; i < aBorder; i++) {
			s[i] = 'a';
		}
		aBorder = badPos + 1;
		return badPos;
	}

}

import java.io.* ;
import java.util.*;

import static java.lang.Math.* ;
import static java.util.Arrays.* ;

public class B {

	public static void main(String[] args)  {

		new B().solveProblem();

		out.close();
	}

	static Input in = new Input() ;
	static PrintStream out = new PrintStream(new BufferedOutputStream(System.out));
	static Output out2 = new Output(out) ;

	int k ;
	char[] cs ;
	int n ;
	long[] ma ;
	static final long MOD = 1000000007 ;

	public void solveProblem()  {

		k = in.nextInt();
		cs = in.next().toCharArray() ;
		n = cs.length ;

		voor = new long[n+1] ;
		na = new long[n+1] ;
		ma = new long[n+1] ;
		ma[0] = 1 ;
		for( int i = 1 ; i <= n ; i++ )
			ma[i] = (ma[i-1]*26) % MOD ;

		for( int i = 0 ; i < n ; i++ )
			adjust(voor,i,(ma[i]*(cs[i]-'a'))%MOD) ;
		for( int i = n - 1 ; i >= 0 ; i-- )
			adjust(na,i,(ma[n-1-i]*(cs[i]-'a'))%MOD) ;

		int z = k-1 ;

		while( z < n - 1 && !palin(z) )
			z++ ;
		while( true ){
			while( z >= 0 && cs[z] == 'z'){
				cs[z] = 'a' ;
				adjust(voor,z,m(-25*ma[z])) ;
				adjust(na,z,m(-25*ma[n-1-z])) ;
				z-- ;
			}
			if( z < 0 ){
				out.println("Impossible") ;
				return ;
			}
			adjust(voor,z,ma[z]) ;
			adjust(na,z,ma[n-1-z]) ;
			cs[z]++ ;

			if( !palin(z))
				break ;
		}
		for( int i = z + 1 ; i < n ; i++){
			for( char c = 'a' ; c <= 'c' ; c++ ){
				adjust(voor,i,m((c-cs[i])*ma[i])) ;
				adjust(na,i,m((c-cs[i])*ma[n-1-i])) ;
				cs[i] = c ;
				if( c == 'c' || !palin(i) )
					break ;
			}
		}

		out2.wr(cs) ;

	}

	private boolean palin(int z) {
		return ((z-k>=0) && palin2(z-k,z)) || (z-k+1>=0 &&palin2(z-k+1,z));
	}

	private boolean palin2(int van, int tot) {
		long a = m( rsq(voor,van,tot)*ma[n-1-tot] );
		long b = m( rsq(na,van,tot)*ma[van] ) ;
		return (MOD+ a)%MOD == (MOD + b) % MOD;
	}

	long[] voor ;
	long[] na ;

	long rsq( long[] fenwick, int k ){
		long som = 0 ;

		while( k > 0 ){
			som = m(som+fenwick[k]) ;
			k -= (k & (-k)) ;
		}

		return som ;

	}

//som is inclusief !
	long rsq( long[] fenwick, int l, int h){

		l++ ;
		h++ ;

		if( l > h )
			return 0 ;
		if( l == 0 )
			return rsq( fenwick, h ) ;
		return m(rsq( fenwick, h ) - rsq( fenwick, l-1 )) ;
	}

	void adjust( long[] fenwick, int k, long v){
		k++ ;
		while( k < fenwick.length ){
			fenwick[k] = (fenwick[k] + v)%MOD ;
			k += (k & (-k)) ;
		}
	}

	static int[] toArray( ArrayList<Integer> lijst ){
		int[] res = new int[lijst.size()] ;
		int t = 0 ;
		for( int i : lijst)
			res[t++] = i;
		return res ;
	}

	static void p( Object ...p){
		System.out.println(Arrays.deepToString(p));
	}

	static long m( long g ){
		return (g%MOD) ;
	}

}

class Input {

	BufferedReader buf = new BufferedReader(new InputStreamReader(System.in));
	StringTokenizer tokens ;

	public int nextInt(){
		return Integer.parseInt(next()) ;
	}

	public int[] nextInt(int n ){
		int[] res = new int[n] ;
		for( int i = 0 ; i < n ; i++ )
			res[i] = nextInt() ;
		return res ;
	}

	public long nextLong(){
		return Long.parseLong(next()) ;
	}

	public long[] nextLong(int n ){
		long[] res = new long[n] ;
		for( int i = 0 ; i < n ; i++ )
			res[i] = nextLong() ;
		return res ;
	}

	public double nextDouble(){
		return Double.parseDouble(next()) ;
	}

	public String next(){

		try{
			while( tokens == null || !tokens.hasMoreTokens() )
				tokens = new StringTokenizer(buf.readLine()) ;
		}catch( Exception e ){
			e.printStackTrace() ;
		}

		return tokens.nextToken() ;
	}

}

class Output {

	PrintStream out ;

	public Output(PrintStream out) {
		this.out = out;
	}

	void wr( int[] rij ){
		for( int i = 0 ; i < rij.length - 1 ; i++ )
			out.print(rij[i] + " ") ;
		out.println(rij[rij.length-1]);
	}

	void wr( long[] rij ){
		for( int i = 0 ; i < rij.length - 1 ; i++ )
			out.print(rij[i] + " ") ;
		out.println(rij[rij.length-1]);
	}

	void wr( char[] rij){
		out.println(new String(rij)) ;
	}

}

import java.io.* ;
import java.util.*;

import static java.lang.Math.* ;
import static java.util.Arrays.* ;

public class A {

	public static void main(String[] args) throws IOException {

		new A().solveProblem();

		out.close();
	}

	static Scanner in = new Scanner(new InputStreamReader(System.in));
	static BufferedReader buf = new BufferedReader(new InputStreamReader(System.in));
	static PrintStream out = new PrintStream(new BufferedOutputStream(System.out));

	static final long MOD = 1000000007 ;
	static final long d = 26 ;

	int k ;
	char[] cs ;
	int n ;
	static long[] macht ;
	public void solveProblem() throws IOException {

		k = Int() ;
		cs = Line().toCharArray() ;
		n = cs.length ;

		macht = new long[n] ;
		macht[0] = 1 ;
		for( int i = 1 ; i < n ; i++ )
			macht[i] = (macht[i-1]*d) % MOD ;

		voor = new Fenwick(n) ;
		achter = new Fenwick(n) ;

		for( int i = 0 ; i < n ; i++ ){

			int v = cs[i] - 'a' ;
			voor.adjust(1+i, (v*macht[i])%MOD ) ;

			v = cs[n-i-1] - 'a' ;
			achter.adjust(n-i, (v*macht[i])%MOD ) ;
		}

		int z = n - 1 ;
		for( int i = k -1 ; i < n ; i++ ){

			if( pa(i)){
				z = i ;
				break ;
			}
		}

		boolean ok = false ;

		while( ! ok ){

			while( cs[z] == 'z'){
				voor.adjust(z+1, (macht[z]*-25) % MOD ) ;
				achter.adjust(z+1, (macht[n-z-1]*-25) % MOD ) ;
				cs[z--] = 'a' ;
				if( z < 0 ){
					out.println("Impossible") ;
					return ;
				}
			}

			cs[z]++ ;
			voor.adjust(z+1, (macht[z]) % MOD ) ;
			achter.adjust(z+1, (macht[n-z-1]) % MOD ) ;
			ok = !pa(z) ;
		}

		for( int i = z + 1 ; i < n ; i++ ){

			for( char c = 'a' ; c <= 'c' ; c++){
				voor.adjust(i+1, (macht[i]*(-cs[i]+c)) % MOD ) ;
				achter.adjust(i+1, (macht[n-i-1]*(-cs[i]+c)) % MOD ) ;
				cs[i] = c ;

				if( !pa(i))
					break ;
			}
		}

		out.println(new String(cs)) ;

	}

	static boolean deb = false ;
	boolean pa(int i){
		return (i - k + 1 >= 0 && palin(i-k+1,i)) || ( i - k >= 0 && palin(i-k,i)) ;
	}
	private boolean palin(int van, int tot) {

		int l = tot - van + 1 ;

		if( deb )
			p(voor.rsq(van+1,van+l/2) , achter.rsq(van+l/2+1,tot+1) ) ;
		if( l % 2 == 0 )
			return (voor.rsq(van+1,van+l/2) * macht[n-1-van] ) % MOD == (achter.rsq(van+l/2+1,tot+1) * macht[tot] ) % MOD ;
		else
			return ( voor.rsq(van+1,van+l/2) * macht[n-1-van] ) % MOD == (achter.rsq(van+l/2+2,tot+1)* macht[tot] ) % MOD ;

	}

	Fenwick voor ;
	Fenwick achter ;

	class Fenwick{

		public Fenwick( int n ){
			fenwick = new long[n+1] ;
			this.n = n ;
		}
		int n ;
		long[] fenwick ; // aanmaken met n + 1 !!!!!!

		long rsq( int k ){
			long som = 0 ;

			while( k > 0 ){
				som = (som+fenwick[k])%A.MOD ;
				k -= (k & (-k)) ;
			}

			return som ;

		}

		long rsq( int l, int h){
			if( l > h )
				return 0 ;
			if( l == 0 )
				return rsq( h ) ;
			return (MOD+(rsq( h ) - rsq( l-1 )) % MOD) % MOD ;
		}

		void adjust( int k, long v){
			while( k < fenwick.length ){
				fenwick[k] += v ;
				k += (k & (-k)) ;
			}
		}

	}

	static String Line() throws IOException{
		return buf.readLine() ;
	}

	static int bufI = 0 ;
	static int[] bufInts = new int[0] ;

	static int Int() throws IOException{
		if( bufI == bufInts.length )
			bufReaderNInts() ;
		return bufInts[bufI++] ;
	}

	static int[] Int( int n ) throws IOException{
		int[] res = new int[n] ;
		for( int i = 0 ; i < n ; i++ )
			res[i] = Int() ;
		return res ;
	}

	static void bufReaderNInts() throws IOException{
		String[] ss = buf.readLine().split(" ") ;
		bufInts = new int[ss.length] ;
		for( int i = 0 ; i < ss.length ; i++ ){
			bufInts[i] = Integer.parseInt(ss[i]) ;
		}
		bufI = 0 ;
	}

	static int bufL = 0 ;
	static long[] bufLongs = new long[0] ;

	static long Long() throws IOException{
		if( bufL == bufLongs.length )
			bufReaderNLongs() ;
		return bufLongs[bufL++] ;
	}

	static long[] Long( int n ) throws IOException{
		long[] res = new long[n] ;
		for( int i = 0 ; i < n ; i++ )
			res[i] = Long() ;
		return res ;
	}

	static void bufReaderNLongs() throws IOException{
		String[] ss = buf.readLine().split(" ") ;
		bufLongs = new long[ss.length] ;
		for( int i = 0 ; i < ss.length ; i++ ){
			bufLongs[i] = Long.parseLong(ss[i]) ;
		}
		bufL = 0 ;
	}

	static int[] toArray( ArrayList<Integer> lijst ){
		int[] res = new int[lijst.size()] ;
		int t = 0 ;
		for( int i : lijst)
			res[t++] = i;
		return res ;
	}

	static void p( Object ...p){
		System.out.println(Arrays.deepToString(p));
	}

	static void wr( int[] rij ){
		for( int i = 0 ; i < rij.length - 1 ; i++ )
			out.print(rij[i] + " ") ;
		out.println(rij[rij.length-1]);

	}

	static void wr( long[] rij ){
		for( int i = 0 ; i < rij.length - 1 ; i++ )
			out.print(rij[i] + " ") ;
		out.println(rij[rij.length-1]);

	}

}

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;

public class Main {

	public static void main(String[] args) {
		try {
			BufferedReader questionreader = new BufferedReader(new InputStreamReader(System.in));
			PrintWriter answerwriter = new PrintWriter(System.out);

			int D = Integer.parseInt(questionreader.readLine());
			char[] S = questionreader.readLine().toCharArray();

			answerwriter.println(analyze(D, S));

			answerwriter.close();
			questionreader.close();

		} catch (FileNotFoundException e) {
			e.printStackTrace();
			return;
		} catch (IOException e) {
			e.printStackTrace();
			return;
		}
	}

	public static int[] l = null;
	public static int[] n = null;
	public static int[] o = null;
	public static int[] u = null;

	public static String analyze(final int D, final char[] S) {
		S[S.length-1]++;
		int i = S.length-1;
		while (S[i] > 'z') {
			if (i == 0) return "Impossible";
			S[i] = 'a';
			S[--i]++;
		}
		l = new int[S.length+1];
		n = new int[S.length+1];
		o = new int[S.length+1];
		u = new int[S.length+1];
		int[] t = new int[S.length+1];
		t[0] = D-1;
		i = 0;
		while (i < S.length) {
			if (S[i] == '0') {
				S[i] = 'a';
				if (i+1 < S.length) S[i+1] = '0';
			}
			u[i+1] = u[i]+S[i];
			if (i>0) {
				if (S[i]==S[i-1]) { l[i]=l[i-1]; n[l[i]]++; o[i]=o[i-1]+1; }
				else { l[i]=l[i-1]+1; n[l[i]]=0; o[i]=0; }
			} else { l[i]=0; n[l[i]]=0; o[i]=0; }

			if (i >= t[i]) {
				if (check(i-D, i, S) || check(i-D+1, i, S)) {
					if (i+1 < S.length) S[i+1] = '0';
					S[i]++;
					n[l[i]]--;
					while (S[i] > 'z') {
						if (i == 0) return "Impossible";
						S[i] = '0';
						S[--i]++;
						n[l[i]]--;
					}
					continue;
				}
			}
			int j = i;
			i++;
			t[i] = Math.max(i, t[i-1]);
			int k = j-D+1+(t[i]-j)*2;
			while (t[i] < S.length && k < j) {
				if (k < 0) { t[i]++; k+=2; continue; }
				if (k == 0) {
					if (S[j]!=S[k]) { t[i]++; k+=2; continue; }
				} else {
					if (S[j]!=S[k] && S[j]!=S[k-1]) { t[i]++; k+=2; continue; }
				}
				break;
			}
		}
		return String.valueOf(S);
	}

	public static boolean check(int p, int q, char[] S) {
		if (p < 0) return false;
		int m = (q-p)/2;
		if (u[q+1]-u[q-m] != u[p+m+1]-u[p]) return false;
		while (S[p]==S[q]) {
			m = Math.min(n[l[p]]-o[p],o[q])+1;
			p+=m;
			q-=m;
			if (p>q) return true;
		}
		return false;
	}
}

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;

public class Main {

	public static void main(String[] args) {
		try {
			BufferedReader questionreader = new BufferedReader(new InputStreamReader(System.in));
			PrintWriter answerwriter = new PrintWriter(System.out);

			int D = Integer.parseInt(questionreader.readLine());
			char[] S = questionreader.readLine().toCharArray();

			answerwriter.println(analyze(D, S));

			answerwriter.close();
			questionreader.close();

		} catch (FileNotFoundException e) {
			e.printStackTrace();
			return;
		} catch (IOException e) {
			e.printStackTrace();
			return;
		}
	}

	public static String analyze(final int D, final char[] S) {
		S[S.length-1]++;
		int i = S.length-1;
		while (S[i] > 'z') {
			if (i == 0) return "Impossible";
			S[i] = 'a';
			S[--i]++;
		}
		int[] t = new int[S.length+1];
		t[0] = D-1;
		i = 0;
		while (i < S.length) {
			if (S[i] == '0') {
				S[i] = 'a';
				if (i+1 < S.length) S[i+1] = '0';
			}
			if (i >= t[i]) {
				if (check(i-D, i, S) || check(i-D+1, i, S)) {
					if (i+1 < S.length) S[i+1] = '0';
					S[i]++;
					while (S[i] > 'z') {
						if (i == 0) return "Impossible";
						S[i] = '0';
						S[--i]++;
					}
					continue;
				}
			}
			int j = i;
			i++;
			t[i] = Math.max(i, t[i-1]);
			int k = j-D+1+(t[i]-j)*2;
			while (t[i] < S.length && k < j) {
				if (k < 0) { t[i]++; k+=2; continue; }
				if (k == 0) {
					if (S[j]!=S[k]) { t[i]++; k+=2; continue; }
				} else {
					if (S[j]!=S[k] && S[j]!=S[k-1]) { t[i]++; k+=2; continue; }
				}
				break;
			}
		}
		return String.valueOf(S);
	}

	public static boolean check(int p, int q, char[] S) {
		if (p < 0) return false;
		if (S[p]==S[q]) return true;
		return false;
	}
}

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;

public class Main {

	public static void main(String[] args) {
		try {
			BufferedReader questionreader = new BufferedReader(new InputStreamReader(System.in));
			PrintWriter answerwriter = new PrintWriter(System.out);

			int D = Integer.parseInt(questionreader.readLine());
			char[] S = questionreader.readLine().toCharArray();
			answerwriter.println(analyze(D, S));

			answerwriter.close();
			questionreader.close();

		} catch (FileNotFoundException e) {
			e.printStackTrace();
			return;
		} catch (IOException e) {
			e.printStackTrace();
			return;
		}
	}

	public static String analyze(final int D, final char[] S) {
		S[S.length-1]++;
		int i = S.length-1;
		while (S[i] > 'z') {
			if (i == 0) return "Impossible";
			S[i] = 'a';
			S[--i]++;
		}
		int t = 0;
		i = 0;
		while (i < S.length) {
			if (S[i] == '0') {
				S[i] = 'a';
				if (i+1 < S.length) S[i+1] = '0';
			}
			if (i < t) { i++; continue; }
			if (check(i-D, i, S) || check(i-D+1, i, S)) {
				if (i+1 < S.length) S[i+1] = '0';
				S[i]++;
				while (S[i] > 'z') {
					if (i == 0) return "Impossible";
					S[i] = '0';
					S[--i]++;
				}
				continue;
			}
			int j = i;
			int k = i-D+3;
			i++;
			t = i;
			while (t < S.length && k < j) {
				if (k < 0) { t++; k+=2; continue; }
				if (k == 0) {
					if (S[j]!=S[k]) { t++; k+=2; continue; }
				} else {
					if (S[j]!=S[k] && S[j]!=S[k-1]) { t++; k+=2; continue; }
				}
				break;
			}
		}
		return String.valueOf(S);
	}

	public static boolean check(int p, int q, char[] S) {
		if (p < 0) return false;
		while (S[p]==S[q]) {
			p++;
			q--;
			if (p>q) return true;
		}
		return false;
	}
}

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;

public class Main {

	public static void main(String[] args) {
		try {
			BufferedReader questionreader = new BufferedReader(new InputStreamReader(System.in));
			PrintWriter answerwriter = new PrintWriter(System.out);

			int D = Integer.parseInt(questionreader.readLine());
			char[] S = questionreader.readLine().toCharArray();
			answerwriter.println(analyze(D, S));

			answerwriter.close();
			questionreader.close();

		} catch (FileNotFoundException e) {
			e.printStackTrace();
			return;
		} catch (IOException e) {
			e.printStackTrace();
			return;
		}
	}

	public static String analyze(final int D, final char[] S) {
		S[S.length-1]++;
		int i = S.length-1;
		while (S[i] > 'z') {
			if (i == 0) return "Impossible";
			S[i] = 'a';
			S[--i]++;
		}
		boolean[] f = new boolean[S.length];
		int t = D-1;
		i = 0;
		while (i < S.length) {
			if (S[i] == '0') break;
			if (i > 1 && i+D/2-1 < S.length) {
				if (S[i-1]!=S[i] && S[i-2]!= S[i]) f[i+D/2-1] = true;
				else f[i+D/2-1] = false;
			}
			if (i < t) { i++; continue; }
			if (!f[i] && (check(i-D+1, i, S) || check(i-D, i, S))) {
				if (i+1 < S.length) S[i+1] = '0';
				S[i]++;
				while (S[i] > 'z') {
					if (i == 0) return "Impossible";
					S[i] = '0';
					S[--i]++;
					t = 0;
				}
				continue;
			}
			int j = i;
			int k = i-D+3;
			i++;
			t = i;
			while (t < S.length && k < j) {
				if (k < 0) { t++; k+=2; continue; }
				if (k == 0) {
					if (S[j]!=S[k]) { t++; k+=2; continue; }
				} else {
					if (S[j]!=S[k] && S[j]!=S[k-1]) { t++; k+=2; continue; }
				}
				break;
			}
		}
		while (i < S.length) {
			S[i] = 'a';
			if (i > 1 && i+D/2-1 < S.length) {
				if (S[i-1]!=S[i] && S[i-2]!= S[i]) f[i+D/2-1] = true;
				else f[i+D/2-1] = false;
			}
			if (i < t) { i++; continue; }
			while (!f[i] && (check(i-D+1, i, S) || check(i-D, i, S))) {
				S[i]++;
				if (i > 1 && i+D/2-1 < S.length) {
					if (S[i-1]!=S[i] && S[i-2]!= S[i]) f[i+D/2-1] = true;
					else f[i+D/2-1] = false;
				}
			}
			int j = i;
			int k = i-D+3;
			i++;
			t = i;
			while (t < S.length && k < j) {
				if (k < 0) { t++; k+=2; continue; }
				if (k == 0) {
					if (S[j]!=S[k]) { t++; k+=2; continue; }
				} else {
					if (S[j]!=S[k] && S[j]!=S[k-1]) { t++; k+=2; continue; }
				}
				break;
			}
		}
		return String.valueOf(S);
	}

	public static boolean check(int p, int q, char[] S) {
		if (p < 0) return false;
		while (S[p]==S[q]) {
			p++;
			q--;
			if (p>q) return true;
		}
		return false;
	}
}

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;

public class Main {

	public static void main(String[] args) {
		try {
			BufferedReader questionreader = new BufferedReader(new InputStreamReader(System.in));
			PrintWriter answerwriter = new PrintWriter(System.out);

//			int D = Integer.parseInt(questionreader.readLine());
//			char[] S = questionreader.readLine().toCharArray();
//			answerwriter.println(analyze(D, S));

			int D = 199999;
			char[] S = new char[400000];
			Arrays.fill(S, 'a');
			analyze(D, S);

			answerwriter.close();
			questionreader.close();

		} catch (FileNotFoundException e) {
			e.printStackTrace();
			return;
		} catch (IOException e) {
			e.printStackTrace();
			return;
		}
	}

	public static String analyze(final int D, final char[] S) {
		S[S.length-1]++;
		int i = S.length-1;
		while (S[i] > 'z') {
			if (i == 0) return "Impossible";
			S[i] = 'a';
			S[--i]++;
		}
		int t = 0;
		i = 0;
		while (i < S.length) {
			if (S[i] == '0') {
				S[i] = 'a';
				if (i+1 < S.length) S[i+1] = '0';
			}
			if (i < t) { i++; continue; }
			if (check(i-D, i, S) || check(i-D+1, i, S)) {
				if (i+1 < S.length) S[i+1] = '0';
				S[i]++;
				while (S[i] > 'z') {
					if (i == 0) return "Impossible";
					S[i] = '0';
					S[--i]++;
				}
				continue;
			}
			int j = i;
			int k = i-D+3;
			i++;
			t = i;
			while (t < S.length && k < j) {
				if (k < 0) { t++; k+=2; continue; }
				if (k == 0) {
					if (S[j]!=S[k]) { t++; k+=2; continue; }
				} else {
					if (S[j]!=S[k] && S[j]!=S[k-1]) { t++; k+=2; continue; }
				}
				break;
			}
		}
		return String.valueOf(S);
	}

	public static boolean check(int p, int q, char[] S) {
		if (p < 0) return false;
		while (S[p]==S[q]) {
			p++;
			q--;
			if (p>q) return true;
		}
		return false;
	}
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;

public class TaskD implements Runnable {

	char str[];
	int most, n;
	final int MOD = 1000000003, MUL = 37;
	int hash[], rhash[];
	long power[];

	private long key(int l, int r)
	{
		long ret = (hash[r + 1] - hash[l] * power[r - l + 1]) % MOD;
		if (ret < 0) ret += MOD;
		return ret;
	}

	private long rkey(int l, int r)
	{
		long ret = (rhash[r + 1] - rhash[l]) % MOD;
		if (ret < 0) ret += MOD;
		return ret;
	}

	private boolean par(int l, int r)
	{
		if (l < 0) return false;

		int mid = (l + r) >> 1, len = r - l + 1;
		if (len % 2 == 1)
			return key(l, mid) * power[mid] % MOD == rkey(mid, r);
		return key(l, mid) * power[mid+1]  % MOD== rkey(mid+1, r);
	}

    private void solve() throws IOException {
    	most = nextInt();
    	String s = nextToken();
    	str = s.toCharArray();
    	n = s.length();

    	boolean good = false;
    	for (int i = n-1; i >= 0; --i)
    	{
    		if (str[i] != 'z')
    		{
    			++str[i];
    			for (int j = i+1; j < n; ++j)
    				str[j] = 'a';
    			good = true;
    			break;
    		}
    	}

    	if (!good)
    	{
    		writer.println("Impossible");
    		return;
    	}

    	hash = new int[n + 1];
    	rhash = new int[n + 1];
    	power = new long[n + 1];

    	hash[0] = 0;
    	rhash[0] = 0;
    	power[0] = 1;
    	for (int i = 1; i <= n; ++i)
    		power[i] = power[i-1] * MUL % MOD;

    	int where = -1;
    	for (int i = 0; i < n; ++i)
    	{
    		hash[i+1] = (int)((hash[i] * (long)MUL + (str[i] - 'a')) % MOD);
    		rhash[i+1] = (int)((rhash[i] + power[i] * (str[i] - 'a')) % MOD);

    		if (par(i - most + 1, i) || par(i - most, i))
    		{
    			where = i;
    			break;
    		}
    	}

    	while (where >= 0)
    	{
    		boolean ok = false;
    		for (char i = (char) (str[where] + 1); !ok && i <= 'z'; ++i)
    		{
    			hash[where+1] = (int)((hash[where] * (long)MUL + (i - 'a')) % MOD);
        		rhash[where+1] = (int)((rhash[where] + power[where] * (i - 'a')) % MOD);
    			str[where] = i;

    			ok = true;
        		if (par(where - most + 1, where) || par(where - most, where))
        			ok = false;
    		}

    		if (ok) break;
    		--where;
    	}

    	if (where < 0)
    	{
    		writer.println("Impossible");
    		return;
    	}

    	for (int p = where+1; p < n; ++p)
    	{
    		for (char i = 'a'; i <= 'z'; ++i)
    		{
    			hash[p+1] = (int)((hash[p] * (long)MUL + (i - 'a')) % MOD);
        		rhash[p+1] = (int)((rhash[p] + power[p] * (i - 'a')) % MOD);
    			str[p] = i;

        		if (!par(p - most + 1, p) && !par(p - most, p))
        			break;
    		}
    	}

    	writer.println(String.valueOf(str));
    }

    public static void main(String[] args) {
        new TaskD().run();
    }

    BufferedReader reader;
    StringTokenizer tokenizer;
    PrintWriter writer;

    public void run() {
        try {
            reader = new BufferedReader(new InputStreamReader(System.in));
            tokenizer = null;
            writer = new PrintWriter(System.out);
            solve();
            reader.close();
            writer.close();
        } catch (Exception e) {
            e.printStackTrace();
            System.exit(1);
        }
    }

    int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }

    long nextLong() throws IOException {
        return Long.parseLong(nextToken());
    }

    double nextDouble() throws IOException {
        return Double.parseDouble(nextToken());
    }

    String nextToken() throws IOException {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            tokenizer = new StringTokenizer(reader.readLine());
        }
        return tokenizer.nextToken();
    }
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;

public class TaskD implements Runnable {

	char str[];
	int most, n;
	final int MOD = 1000000007, MUL = 37;
	int hash[], rhash[];
	long power[];

	private long key(int l, int r)
	{
		long ret = (hash[r + 1] - hash[l] * power[r - l + 1]) % MOD;
		if (ret < 0) ret += MOD;
		return ret;
	}

	private long rkey(int l, int r)
	{
		long ret = (rhash[r + 1] - rhash[l]) % MOD;
		if (ret < 0) ret += MOD;
		return ret;
	}

	private boolean par(int l, int r)
	{
		if (l < 0) return false;

		int mid = (l + r) >> 1, len = r - l + 1;
		if (len % 2 == 1)
			return key(l, mid) * power[mid] % MOD == rkey(mid, r);
		return key(l, mid) * power[mid+1]  % MOD== rkey(mid+1, r);
	}

    private void solve() throws IOException {
    	most = nextInt();
    	String s = nextToken();
    	str = s.toCharArray();
    	n = s.length();

    	boolean good = false;
    	for (int i = n-1; i >= 0; --i)
    	{
    		if (str[i] != 'z')
    		{
    			++str[i];
    			for (int j = i+1; j < n; ++j)
    				str[j] = 'a';
    			good = true;
    			break;
    		}
    	}

    	if (!good)
    	{
    		writer.println("Impossible");
    		return;
    	}

    	hash = new int[n + 1];
    	rhash = new int[n + 1];
    	power = new long[n + 1];

    	hash[0] = 0;
    	rhash[0] = 0;
    	power[0] = 1;
    	for (int i = 1; i <= n; ++i)
    		power[i] = power[i-1] * MUL % MOD;

    	int where = -1;
    	for (int i = 0; i < n; ++i)
    	{
    		hash[i+1] = (int)((hash[i] * (long)MUL + (str[i] - 'a')) % MOD);
    		rhash[i+1] = (int)((rhash[i] + power[i] * (str[i] - 'a')) % MOD);

    		if (par(i - most + 1, i) || par(i - most, i))
    		{
    			where = i;
    			break;
    		}
    	}

    	while (where >= 0)
    	{
    		boolean ok = false;
    		for (char i = (char) (str[where] + 1); !ok && i <= 'z'; ++i)
    		{
    			hash[where+1] = (int)((hash[where] * (long)MUL + (i - 'a')) % MOD);
        		rhash[where+1] = (int)((rhash[where] + power[where] * (i - 'a')) % MOD);
    			str[where] = i;

    			ok = true;
        		if (par(where - most + 1, where) || par(where - most, where))
        			ok = false;
    		}

    		if (ok) break;
    		--where;
    	}

    	if (where < 0)
    	{
    		writer.println("Impossible");
    		return;
    	}

    	for (int p = where+1; p < n; ++p)
    	{
    		for (char i = 'a'; i <= 'z'; ++i)
    		{
    			hash[p+1] = (int)((hash[p] * (long)MUL + (i - 'a')) % MOD);
        		rhash[p+1] = (int)((rhash[p] + power[p] * (i - 'a')) % MOD);
    			str[p] = i;

        		if (!par(p - most + 1, p) && !par(p - most, p))
        			break;
    		}
    	}

    	writer.println(String.valueOf(str));
    }

    public static void main(String[] args) {
        new TaskD().run();
    }

    BufferedReader reader;
    StringTokenizer tokenizer;
    PrintWriter writer;

    public void run() {
        try {
            reader = new BufferedReader(new InputStreamReader(System.in));
            tokenizer = null;
            writer = new PrintWriter(System.out);
            solve();
            reader.close();
            writer.close();
        } catch (Exception e) {
            e.printStackTrace();
            System.exit(1);
        }
    }

    int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }

    long nextLong() throws IOException {
        return Long.parseLong(nextToken());
    }

    double nextDouble() throws IOException {
        return Double.parseDouble(nextToken());
    }

    String nextToken() throws IOException {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            tokenizer = new StringTokenizer(reader.readLine());
        }
        return tokenizer.nextToken();
    }
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;

public class TaskD implements Runnable {

	char str[];
	int most, n;
	final int MOD = 1000000007, MUL = 29;
	int hash[], rhash[];
	long power[];

	private long key(int l, int r)
	{
		long ret = (hash[r + 1] - hash[l] * power[r - l + 1]) % MOD;
		if (ret < 0) ret += MOD;
		return ret;
	}

	private long rkey(int l, int r)
	{
		long ret = (rhash[r + 1] - rhash[l]) % MOD;
		if (ret < 0) ret += MOD;
		return ret;
	}

	private boolean par(int l, int r)
	{
		if (l < 0) return false;

		int mid = (l + r) >> 1, len = r - l + 1;
		if (len % 2 == 1)
			return key(l, mid) * power[mid] % MOD == rkey(mid, r);
		return key(l, mid) * power[mid+1]  % MOD== rkey(mid+1, r);
	}

    private void solve() throws IOException {
    	most = nextInt();
    	String s = nextToken();
    	str = s.toCharArray();
    	n = s.length();

    	boolean good = false;
    	for (int i = n-1; i >= 0; --i)
    	{
    		if (str[i] != 'z')
    		{
    			++str[i];
    			for (int j = i+1; j < n; ++j)
    				str[j] = 'a';
    			good = true;
    			break;
    		}
    	}

    	if (!good)
    	{
    		writer.println("Impossible");
    		return;
    	}

    	hash = new int[n + 1];
    	rhash = new int[n + 1];
    	power = new long[n + 1];

    	hash[0] = 0;
    	rhash[0] = 0;
    	power[0] = 1;
    	for (int i = 1; i <= n; ++i)
    		power[i] = power[i-1] * MUL % MOD;

    	int where = -1;
    	for (int i = 0; i < n; ++i)
    	{
    		hash[i+1] = (int)((hash[i] * (long)MUL + (str[i] - 'a')) % MOD);
    		rhash[i+1] = (int)((rhash[i] + power[i] * (str[i] - 'a')) % MOD);

    		if (par(i - most + 1, i) || par(i - most, i))
    		{
    			where = i;
    			break;
    		}
    	}

    	while (where >= 0)
    	{
    		boolean ok = false;
    		for (char i = (char) (str[where] + 1); !ok && i <= 'z'; ++i)
    		{
    			hash[where+1] = (int)((hash[where] * (long)MUL + (i - 'a')) % MOD);
        		rhash[where+1] = (int)((rhash[where] + power[where] * (i - 'a')) % MOD);
    			str[where] = i;

    			ok = true;
        		if (par(where - most + 1, where) || par(where - most, where))
        			ok = false;
    		}

    		if (ok) break;
    		--where;
    	}

    	if (where < 0)
    	{
    		writer.println("Impossible");
    		return;
    	}

    	for (int p = where+1; p < n; ++p)
    	{
    		for (char i = 'a'; i <= 'z'; ++i)
    		{
    			hash[p+1] = (int)((hash[p] * (long)MUL + (i - 'a')) % MOD);
        		rhash[p+1] = (int)((rhash[p] + power[p] * (i - 'a')) % MOD);
    			str[p] = i;

        		if (!par(p - most + 1, p) && !par(p - most, p))
        			break;
    		}
    	}

    	writer.println(String.valueOf(str));
    }

    public static void main(String[] args) {
        new TaskD().run();
    }

    BufferedReader reader;
    StringTokenizer tokenizer;
    PrintWriter writer;

    public void run() {
        try {
            reader = new BufferedReader(new InputStreamReader(System.in));
            tokenizer = null;
            writer = new PrintWriter(System.out);
            solve();
            reader.close();
            writer.close();
        } catch (Exception e) {
            e.printStackTrace();
            System.exit(1);
        }
    }

    int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }

    long nextLong() throws IOException {
        return Long.parseLong(nextToken());
    }

    double nextDouble() throws IOException {
        return Double.parseDouble(nextToken());
    }

    String nextToken() throws IOException {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            tokenizer = new StringTokenizer(reader.readLine());
        }
        return tokenizer.nextToken();
    }
}

//package prac;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.InputMismatchException;

public class P124D {
	InputStream is;
	PrintWriter out;
	String INPUT = "";

	void solve()
	{
		int d = ni();
		char[] s = ns(400003);
		int n = s.length;

		int H = 47;
		long[] es = new long[n+3];
		es[0] = 1;
		for(int i = 0;i < n+2;i++){
			es[i+1] = es[i] * H;
		}

		long[] hs = new long[n];
		for(int i = 0;i < n;i++){
			hs[i] = es[i] * (s[i]-'a'+1);
		}
		long[] rhs = new long[n];
		for(int i = 0;i < n;i++){
			rhs[i] = es[n-1-i] * (s[i]-'a'+1);
		}

		long[] hft = buildFenwick(hs);
		long[] rhft = buildFenwick(rhs);

		boolean first = true;
		for(int i = d-1;i < n;i++){
			// iが最後になる、制約を破るpalindromeができてしまうかチェック
			if(palin(i, d, n, hft, rhft, es) || palin(i, d+1, n, hft, rhft, es)){
				// できるならiをインクリメント
				s[i]++;
				addFenwick(hft, i, es[i]);
				addFenwick(rhft, i, es[n-1-i]);
				if(first){
					// 初回なら更地に
					for(int j = i+1;j < n;j++){
						addFenwick(hft, j, ('a'-s[j])*es[j]);
						addFenwick(rhft, j, ('a'-s[j])*es[n-1-j]);
						s[j] = 'a';
					}
					first = false;
				}
				while(s[i] > 'z'){
					if(i == 0){
						out.println("Impossible");
						return;
					}
					s[i] = 'a';
					addFenwick(hft, i, -26*es[i]);
					addFenwick(rhft, i, -26*es[n-1-i]);
					i--;
					s[i]++;
					addFenwick(hft, i, es[i]);
					addFenwick(rhft, i, es[n-1-i]);
				}
				i--;
			}
		}
		out.println(new String(s));
	}

	boolean palin(int end, int d, int n, long[] hft, long[] rhft, long[] es)
	{
		if(end-d+1 < 0)return false;
		int h = d/2;
		long first = (sumFenwick(hft, end-d+h) - sumFenwick(hft, end-d)) * es[n-(end-d+h)];
		long last = (sumFenwick(rhft, end) - sumFenwick(rhft, end-h)) * es[end-h+2];
		return first == last;
	}

	public static long sumFenwick(long[] ft, int i)
	{
		long sum = 0;
		for(i++;i > 0;i -= i&-i)sum += ft[i];
		return sum;
	}

	public static void addFenwick(long[] ft, int i, long v)
	{
		if(v == 0)return;
		int n = ft.length;
		for(i++;i < n;i += i&-i)ft[i] += v;
	}

	public static long[] restoreFenwick(long[] ft)
	{
		int n = ft.length-1;
		long[] ret = new long[n];
		for(int i = 0;i < n;i++)ret[i] = sumFenwick(ft, i);
		for(int i = n-1;i >= 1;i--)ret[i] -= ret[i-1];
		return ret;
	}

	public static long[] buildFenwick(long[] a)
	{
		int n = a.length;
		long[] ft = new long[n+1];
		System.arraycopy(a, 0, ft, 1, n);
		for(int k = 2, h = 1;k <= n;k*=2, h*=2){
			for(int i = k;i <= n;i+=k){
				ft[i] += ft[i-h];
			}
		}
		return ft;
	}

	void run() throws Exception
	{
//		int n = 400, m = 99999;
//		Random gen = new Random();
//		StringBuilder sb = new StringBuilder();
//		sb.append(gen.nextInt(10)+1 + " ");
//		for(int i = 0;i < n;i++){
//			sb.append((char)('a'+gen.nextInt(1)));
//		}
//		INPUT = sb.toString();

		is = oj ? System.in : new ByteArrayInputStream(INPUT.getBytes());
		out = new PrintWriter(System.out);

		long s = System.currentTimeMillis();
		solve();
		out.flush();
		tr(System.currentTimeMillis()-s+"ms");
	}

	public static void main(String[] args) throws Exception { new P124D().run(); }

	private byte[] inbuf = new byte[1024];
	private int lenbuf = 0, ptrbuf = 0;

	private int readByte()
	{
		if(lenbuf == -1)throw new InputMismatchException();
		if(ptrbuf >= lenbuf){
			ptrbuf = 0;
			try { lenbuf = is.read(inbuf); } catch (IOException e) { throw new InputMismatchException(); }
			if(lenbuf <= 0)return -1;
		}
		return inbuf[ptrbuf++];
	}

	private boolean isSpaceChar(int c) { return !(c >= 33 && c <= 126); }
	private int skip() { int b; while((b = readByte()) != -1 && isSpaceChar(b)); return b; }

	private char[] ns(int n)
	{
		char[] buf = new char[n];
		int b = skip(), p = 0;
		while(p < n && !(isSpaceChar(b))){
			buf[p++] = (char)b;
			b = readByte();
		}
		return n == p ? buf : Arrays.copyOf(buf, p);
	}

	private int ni()
	{
		int num = 0, b;
		boolean minus = false;
		while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
		if(b == '-'){
			minus = true;
			b = readByte();
		}

		while(true){
			if(b >= '0' && b <= '9'){
				num = num * 10 + (b - '0');
			}else{
				return minus ? -num : num;
			}
			b = readByte();
		}
	}

	private boolean oj = System.getProperty("ONLINE_JUDGE") != null;
	private void tr(Object... o) { if(!oj)System.out.println(Arrays.deepToString(o)); }
}

//package prac;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.InputMismatchException;

public class P124D {
	InputStream is;
	PrintWriter out;
	String INPUT = "";

	void solve()
	{
		int d = ni();
		char[] s = ns(400003);
		int n = s.length;

		int H = 31;
		long[] es = new long[n+3];
		es[0] = 1;
		for(int i = 0;i < n+2;i++){
			es[i+1] = es[i] * H;
		}

		long[] hs = new long[n];
		for(int i = 0;i < n;i++){
			hs[i] = es[i] * (s[i]-'a'+1);
		}
		long[] rhs = new long[n];
		for(int i = 0;i < n;i++){
			rhs[i] = es[n-1-i] * (s[i]-'a'+1);
		}

		long[] hft = buildFenwick(hs);
		long[] rhft = buildFenwick(rhs);

		boolean first = true;
		for(int i = d-1;i < n;i++){
			// iが最後になる、制約を破るpalindromeができてしまうかチェック
			if(palin(i, d, n, hft, rhft, es) || palin(i, d+1, n, hft, rhft, es)){
				// できるならiをインクリメント
				s[i]++;
				addFenwick(hft, i, es[i]);
				addFenwick(rhft, i, es[n-1-i]);
				if(first){
					// 初回なら更地に
					for(int j = i+1;j < n;j++){
						addFenwick(hft, j, ('a'-s[j])*es[j]);
						addFenwick(rhft, j, ('a'-s[j])*es[n-1-j]);
						s[j] = 'a';
					}
					first = false;
				}
				while(s[i] > 'z'){
					if(i == 0){
						out.println("Impossible");
						return;
					}
					s[i] = 'a';
					addFenwick(hft, i, -26*es[i]);
					addFenwick(rhft, i, -26*es[n-1-i]);
					i--;
					s[i]++;
					addFenwick(hft, i, es[i]);
					addFenwick(rhft, i, es[n-1-i]);
				}
				i--;
			}
		}
		out.println(new String(s));
	}

	boolean palin(int end, int d, int n, long[] hft, long[] rhft, long[] es)
	{
		if(end-d+1 < 0)return false;
		int h = d/2;
		long first = (sumFenwick(hft, end-d+h) - sumFenwick(hft, end-d)) * es[n-(end-d+h)];
		long last = (sumFenwick(rhft, end) - sumFenwick(rhft, end-h)) * es[end-h+2];
		return first == last;
	}

	public static long sumFenwick(long[] ft, int i)
	{
		long sum = 0;
		for(i++;i > 0;i -= i&-i)sum += ft[i];
		return sum;
	}

	public static void addFenwick(long[] ft, int i, long v)
	{
		if(v == 0)return;
		int n = ft.length;
		for(i++;i < n;i += i&-i)ft[i] += v;
	}

	public static long[] restoreFenwick(long[] ft)
	{
		int n = ft.length-1;
		long[] ret = new long[n];
		for(int i = 0;i < n;i++)ret[i] = sumFenwick(ft, i);
		for(int i = n-1;i >= 1;i--)ret[i] -= ret[i-1];
		return ret;
	}

	public static long[] buildFenwick(long[] a)
	{
		int n = a.length;
		long[] ft = new long[n+1];
		System.arraycopy(a, 0, ft, 1, n);
		for(int k = 2, h = 1;k <= n;k*=2, h*=2){
			for(int i = k;i <= n;i+=k){
				ft[i] += ft[i-h];
			}
		}
		return ft;
	}

	void run() throws Exception
	{
//		int n = 40000, m = 99999;
//		Random gen = new Random();
//		StringBuilder sb = new StringBuilder();
//		sb.append(gen.nextInt(1)+1 + " ");
//		for(int i = 0;i < n;i++){
//			sb.append((char)('a'+gen.nextInt(26)));
//		}
//		INPUT = sb.toString();

		is = oj ? System.in : new ByteArrayInputStream(INPUT.getBytes());
		out = new PrintWriter(System.out);

		long s = System.currentTimeMillis();
		solve();
		out.flush();
		tr(System.currentTimeMillis()-s+"ms");
	}

	public static void main(String[] args) throws Exception { new P124D().run(); }

	private byte[] inbuf = new byte[1024];
	private int lenbuf = 0, ptrbuf = 0;

	private int readByte()
	{
		if(lenbuf == -1)throw new InputMismatchException();
		if(ptrbuf >= lenbuf){
			ptrbuf = 0;
			try { lenbuf = is.read(inbuf); } catch (IOException e) { throw new InputMismatchException(); }
			if(lenbuf <= 0)return -1;
		}
		return inbuf[ptrbuf++];
	}

	private boolean isSpaceChar(int c) { return !(c >= 33 && c <= 126); }
	private int skip() { int b; while((b = readByte()) != -1 && isSpaceChar(b)); return b; }

	private double nd() { return Double.parseDouble(ns()); }
	private char nc() { return (char)skip(); }

	private String ns()
	{
		int b = skip();
		StringBuilder sb = new StringBuilder();
		while(!(isSpaceChar(b))){ // when nextLine, (isSpaceChar(b) && b != ' ')
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}

	private char[] ns(int n)
	{
		char[] buf = new char[n];
		int b = skip(), p = 0;
		while(p < n && !(isSpaceChar(b))){
			buf[p++] = (char)b;
			b = readByte();
		}
		return n == p ? buf : Arrays.copyOf(buf, p);
	}

	private char[][] nm(int n, int m)
	{
		char[][] map = new char[n][];
		for(int i = 0;i < n;i++)map[i] = ns(m);
		return map;
	}

	private int[] na(int n)
	{
		int[] a = new int[n];
		for(int i = 0;i < n;i++)a[i] = ni();
		return a;
	}

	private int ni()
	{
		int num = 0, b;
		boolean minus = false;
		while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
		if(b == '-'){
			minus = true;
			b = readByte();
		}

		while(true){
			if(b >= '0' && b <= '9'){
				num = num * 10 + (b - '0');
			}else{
				return minus ? -num : num;
			}
			b = readByte();
		}
	}

	private long nl()
	{
		long num = 0;
		int b;
		boolean minus = false;
		while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
		if(b == '-'){
			minus = true;
			b = readByte();
		}

		while(true){
			if(b >= '0' && b <= '9'){
				num = num * 10 + (b - '0');
			}else{
				return minus ? -num : num;
			}
			b = readByte();
		}
	}

	private boolean oj = System.getProperty("ONLINE_JUDGE") != null;
	private void tr(Object... o) { if(!oj)System.out.println(Arrays.deepToString(o)); }
}

//package prac;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.InputMismatchException;

public class P124D {
	InputStream is;
	PrintWriter out;
	String INPUT = "";

	void solve()
	{
		int d = ni();
		char[] s = ns(400003);
		int n = s.length;

		int H = 31;
		long[] es = new long[n+3];
		es[0] = 1;
		for(int i = 0;i < n+2;i++){
			es[i+1] = es[i] * H;
		}

		long[] hs = new long[n];
		for(int i = 0;i < n;i++){
			hs[i] = es[i] * (s[i]-'a'+1);
		}
		long[] rhs = new long[n];
		for(int i = 0;i < n;i++){
			rhs[i] = es[n-1-i] * (s[i]-'a'+1);
		}

		long[] hft = buildFenwick(hs);
		long[] rhft = buildFenwick(rhs);

		boolean first = true;
		for(int i = d-1;i < n;i++){
			// iが最後になる、制約を破るpalindromeができてしまうかチェック
			if(palin(i, d, n, hft, rhft, es) || palin(i, d+1, n, hft, rhft, es)){
				// できるならiをインクリメント
				s[i]++;
				addFenwick(hft, i, es[i]);
				addFenwick(rhft, i, es[n-1-i]);
				if(first){
					// 初回なら更地に
					for(int j = i+1;j < n;j++){
						addFenwick(hft, j, ('a'-s[j])*es[j]);
						addFenwick(rhft, j, ('a'-s[j])*es[n-1-j]);
						s[j] = 'a';
					}
					first = false;
				}
				while(s[i] > 'z'){
					if(i == 0){
						out.println("Impossible");
						return;
					}
					s[i] = 'a';
					addFenwick(hft, i, -26*es[i]);
					addFenwick(rhft, i, -26*es[n-1-i]);
					i--;
					s[i]++;
					addFenwick(hft, i, es[i]);
					addFenwick(rhft, i, es[n-1-i]);
				}
				i--;
			}
		}
		out.println(new String(s));
	}

	boolean palin(int end, int d, int n, long[] hft, long[] rhft, long[] es)
	{
		if(end-d < -1)return false;
		long first = (sumFenwick(hft, end) - sumFenwick(hft, end-d)) * es[n-end];
		long last = (sumFenwick(rhft, end) - sumFenwick(rhft, end-d)) * es[end-d+2];
		return first == last;
	}

	public static long sumFenwick(long[] ft, int i)
	{
		long sum = 0;
		for(i++;i > 0;i -= i&-i)sum += ft[i];
		return sum;
	}

	public static void addFenwick(long[] ft, int i, long v)
	{
		if(v == 0)return;
		int n = ft.length;
		for(i++;i < n;i += i&-i)ft[i] += v;
	}

	public static long[] restoreFenwick(long[] ft)
	{
		int n = ft.length-1;
		long[] ret = new long[n];
		for(int i = 0;i < n;i++)ret[i] = sumFenwick(ft, i);
		for(int i = n-1;i >= 1;i--)ret[i] -= ret[i-1];
		return ret;
	}

	public static long[] buildFenwick(long[] a)
	{
		int n = a.length;
		long[] ft = new long[n+1];
		System.arraycopy(a, 0, ft, 1, n);
		for(int k = 2, h = 1;k <= n;k*=2, h*=2){
			for(int i = k;i <= n;i+=k){
				ft[i] += ft[i-h];
			}
		}
		return ft;
	}

	void run() throws Exception
	{
//		int n = 400000, m = 99999;
//		Random gen = new Random();
//		StringBuilder sb = new StringBuilder();
//		sb.append(gen.nextInt(10)+1 + " ");
//		for(int i = 0;i < n;i++){
//			sb.append((char)('a'+gen.nextInt(1)));
//		}
//		INPUT = sb.toString();

		is = oj ? System.in : new ByteArrayInputStream(INPUT.getBytes());
		out = new PrintWriter(System.out);

		long s = System.currentTimeMillis();
		solve();
		out.flush();
		tr(System.currentTimeMillis()-s+"ms");
	}

	public static void main(String[] args) throws Exception { new P124D().run(); }

	private byte[] inbuf = new byte[1024];
	private int lenbuf = 0, ptrbuf = 0;

	private int readByte()
	{
		if(lenbuf == -1)throw new InputMismatchException();
		if(ptrbuf >= lenbuf){
			ptrbuf = 0;
			try { lenbuf = is.read(inbuf); } catch (IOException e) { throw new InputMismatchException(); }
			if(lenbuf <= 0)return -1;
		}
		return inbuf[ptrbuf++];
	}

	private boolean isSpaceChar(int c) { return !(c >= 33 && c <= 126); }
	private int skip() { int b; while((b = readByte()) != -1 && isSpaceChar(b)); return b; }

	private char[] ns(int n)
	{
		char[] buf = new char[n];
		int b = skip(), p = 0;
		while(p < n && !(isSpaceChar(b))){
			buf[p++] = (char)b;
			b = readByte();
		}
		return n == p ? buf : Arrays.copyOf(buf, p);
	}

	private int ni()
	{
		int num = 0, b;
		boolean minus = false;
		while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
		if(b == '-'){
			minus = true;
			b = readByte();
		}

		while(true){
			if(b >= '0' && b <= '9'){
				num = num * 10 + (b - '0');
			}else{
				return minus ? -num : num;
			}
			b = readByte();
		}
	}

	private boolean oj = System.getProperty("ONLINE_JUDGE") != null;
	private void tr(Object... o) { if(!oj)System.out.println(Arrays.deepToString(o)); }
}

import java.io.InputStreamReader;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskD solver = new TaskD();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskD {
    static final long BASE = 31371;

    public void solve(int testNumber, InputReader in, PrintWriter out) {
        int d1 = in.nextInt();
        int d2 = d1 + 1;
        String s = in.next();
        int n = s.length();
        StringBuilder res = new StringBuilder();
        res.append(s);
        long[] hash = new long[n + 1];
        long[] hashRev = new long[n + 1];
        long[] basePow = new long[n + 1];
        basePow[0] = 1;
        for (int i = 0; i < n; ++i)
            basePow[i + 1] = basePow[i] * BASE;
        boolean bigger = false;
        int i = 0;
        while (i < n) {
            char min = res.charAt(i);
            int oldi = i;
            for (char ch = min; ch <= 'z'; ++ch) {
                if (!bigger && ch > min) {
                    bigger = true;
                    for (int ii = i + 1; ii < n; ++ii)
                        res.setCharAt(ii, 'a');
                }
                res.setCharAt(i, ch);
                hash[i + 1] = hash[i] * BASE + ch;
                hashRev[i + 1] = hashRev[i] + ch * basePow[i];
                boolean ok = true;
                if (i + 1 >= d1) {
                    if ((hash[i + 1] - hash[i + 1 - d1] * basePow[d1]) * basePow[i + 1 - d1] == (hashRev[i + 1] - hashRev[i + 1 - d1])) {
                        ok = false;
                    }
                }
                if (i + 1 >= d2) {
                    if ((hash[i + 1] - hash[i + 1 - d2] * basePow[d2]) * basePow[i + 1 - d2] == (hashRev[i + 1] - hashRev[i + 1 - d2])) {
                        ok = false;
                    }
                }
                if (ok && (bigger || i + 1 < n)) {
                    ++i;
                    break;
                }
            }
            if (i == oldi) {
                res.setCharAt(i, 'a');
                --i;
                while (i >= 0 && res.charAt(i) == 'z') {
                    res.setCharAt(i, 'a');
                    --i;
                }
                if (i < 0) {
                    out.println("Impossible");
                    return;
                }
                res.setCharAt(i, (char) (res.charAt(i) + 1));
                bigger = true;
            }
        }
        out.println(res.toString());
    }
}

class InputReader {
    private BufferedReader reader;
    private StringTokenizer tokenizer;

    public InputReader(InputStream stream) {
        reader = new BufferedReader(new InputStreamReader(stream));
        tokenizer = null;
    }

    public String next() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    }

    public int nextInt() {
        return Integer.parseInt(next());
    }

    }

import java.io.* ;
import java.util.*;

import static java.lang.Math.* ;
import static java.util.Arrays.* ;

public class A {

	public static void main(String[] args) throws IOException {

		new A().solveProblem();

		out.close();
	}

	static Scanner in = new Scanner(new InputStreamReader(System.in));
	static BufferedReader buf = new BufferedReader(new InputStreamReader(System.in));
	static PrintStream out = new PrintStream(new BufferedOutputStream(System.out));

	static final long MOD = 28823037615171101L ;
	static final long d = 26 ;

	int k ;
	char[] cs ;
	int n ;
	static long[] macht ;
	public void solveProblem() throws IOException {

		k = Int() ;
		cs = Line().toCharArray() ;
		n = cs.length ;

		macht = new long[n] ;
		macht[0] = 1 ;
		for( int i = 1 ; i < n ; i++ )
			macht[i] = (macht[i-1]*d) % MOD ;

		voor = new Fenwick(n) ;
		achter = new Fenwick(n) ;

		for( int i = 0 ; i < n ; i++ ){

			int v = cs[i] - 'a' ;
			voor.adjust(1+i, (v*macht[i])%MOD ) ;

			v = cs[n-i-1] - 'a' ;
			achter.adjust(n-i, (v*macht[i])%MOD ) ;
		}

		int z = n - 1 ;
		for( int i = k -1 ; i < n ; i++ ){

			if( pa(i)){
				z = i ;
				break ;
			}
		}

		boolean ok = false ;

		while( ! ok ){

			while( cs[z] == 'z'){
				voor.adjust(z+1, (macht[z]*-25) % MOD ) ;
				achter.adjust(z+1, (macht[n-z-1]*-25) % MOD ) ;
				cs[z--] = 'a' ;
				if( z < 0 ){
					out.println("Impossible") ;
					return ;
				}
			}

			cs[z]++ ;
			voor.adjust(z+1, (macht[z]) % MOD ) ;
			achter.adjust(z+1, (macht[n-z-1]) % MOD ) ;
			ok = !pa(z) ;
		}

		for( int i = z + 1 ; i < n ; i++ ){

			for( char c = 'a' ; c <= 'c' ; c++){
				voor.adjust(i+1, (macht[i]*(-cs[i]+c)) % MOD ) ;
				achter.adjust(i+1, (macht[n-i-1]*(-cs[i]+c)) % MOD ) ;
				cs[i] = c ;

				if( !pa(i))
					break ;
			}
		}

		out.println(new String(cs)) ;

	}

	static boolean deb = false ;
	boolean pa(int i){
		return (i - k + 1 >= 0 && palin(i-k+1,i)) || ( i - k >= 0 && palin(i-k,i)) ;
	}
	private boolean palin(int van, int tot) {

		int l = tot - van + 1 ;

		if( deb )
			p(voor.rsq(van+1,van+l/2) , achter.rsq(van+l/2+1,tot+1) ) ;
		if( l % 2 == 0 )
			return (voor.rsq(van+1,van+l/2) * macht[n-1-van] ) % MOD == (achter.rsq(van+l/2+1,tot+1) * macht[tot] ) % MOD ;
		else
			return ( voor.rsq(van+1,van+l/2) * macht[n-1-van] ) % MOD == (achter.rsq(van+l/2+2,tot+1)* macht[tot] ) % MOD ;

	}

	Fenwick voor ;
	Fenwick achter ;

	class Fenwick{

		public Fenwick( int n ){
			fenwick = new long[n+1] ;
			this.n = n ;
		}
		int n ;
		long[] fenwick ; // aanmaken met n + 1 !!!!!!

		long rsq( int k ){
			long som = 0 ;

			while( k > 0 ){
				som = (som+fenwick[k])%A.MOD ;
				k -= (k & (-k)) ;
			}

			return som ;

		}

		long rsq( int l, int h){
			if( l > h )
				return 0 ;
			if( l == 0 )
				return rsq( h ) ;
			return (MOD+(rsq( h ) - rsq( l-1 )) % MOD) % MOD ;
		}

		void adjust( int k, long v){
			while( k < fenwick.length ){
				fenwick[k] += v ;
				k += (k & (-k)) ;
			}
		}

	}

	static String Line() throws IOException{
		return buf.readLine() ;
	}

	static int bufI = 0 ;
	static int[] bufInts = new int[0] ;

	static int Int() throws IOException{
		if( bufI == bufInts.length )
			bufReaderNInts() ;
		return bufInts[bufI++] ;
	}

	static int[] Int( int n ) throws IOException{
		int[] res = new int[n] ;
		for( int i = 0 ; i < n ; i++ )
			res[i] = Int() ;
		return res ;
	}

	static void bufReaderNInts() throws IOException{
		String[] ss = buf.readLine().split(" ") ;
		bufInts = new int[ss.length] ;
		for( int i = 0 ; i < ss.length ; i++ ){
			bufInts[i] = Integer.parseInt(ss[i]) ;
		}
		bufI = 0 ;
	}

	static int bufL = 0 ;
	static long[] bufLongs = new long[0] ;

	static long Long() throws IOException{
		if( bufL == bufLongs.length )
			bufReaderNLongs() ;
		return bufLongs[bufL++] ;
	}

	static long[] Long( int n ) throws IOException{
		long[] res = new long[n] ;
		for( int i = 0 ; i < n ; i++ )
			res[i] = Long() ;
		return res ;
	}

	static void bufReaderNLongs() throws IOException{
		String[] ss = buf.readLine().split(" ") ;
		bufLongs = new long[ss.length] ;
		for( int i = 0 ; i < ss.length ; i++ ){
			bufLongs[i] = Long.parseLong(ss[i]) ;
		}
		bufL = 0 ;
	}

	static int[] toArray( ArrayList<Integer> lijst ){
		int[] res = new int[lijst.size()] ;
		int t = 0 ;
		for( int i : lijst)
			res[t++] = i;
		return res ;
	}

	static void p( Object ...p){
		System.out.println(Arrays.deepToString(p));
	}

	static void wr( int[] rij ){
		for( int i = 0 ; i < rij.length - 1 ; i++ )
			out.print(rij[i] + " ") ;
		out.println(rij[rij.length-1]);

	}

	static void wr( long[] rij ){
		for( int i = 0 ; i < rij.length - 1 ; i++ )
			out.print(rij[i] + " ") ;
		out.println(rij[rij.length-1]);

	}

}

import java.io.* ;
import java.util.*;

import static java.lang.Math.* ;
import static java.util.Arrays.* ;

public class B {

	public static void main(String[] args)  {

		new B().solveProblem();

		out.close();
	}

	static Input in = new Input() ;
	static PrintStream out = new PrintStream(new BufferedOutputStream(System.out));
	static Output out2 = new Output(out) ;

	int k ;
	char[] cs ;
	int n ;
	long[] ma ;
	static final long MOD = 1000000007 ;

	public void solveProblem()  {

		k = in.nextInt();
		cs = in.next().toCharArray() ;
		n = cs.length ;

		voor = new long[n+1] ;
		na = new long[n+1] ;
		ma = new long[n+1] ;
		ma[0] = 1 ;
		for( int i = 1 ; i <= n ; i++ )
			ma[i] = (ma[i-1]*26) % MOD ;

		for( int i = 0 ; i < n ; i++ )
			adjust(voor,i,(ma[i]*(cs[i]-'a'))%MOD) ;
		for( int i = n - 1 ; i >= 0 ; i-- )
			adjust(na,i,(ma[n-1-i]*(cs[i]-'a'))%MOD) ;

		int z = k-1 ;

		while( z < n - 1 && !palin(z) )
			z++ ;
		while( z >= 0 && palin(z) ){
			while( z >= 0 && cs[z] == 'z'){
				cs[z] = 'a' ;
				adjust(voor,z,m(-25*ma[z])) ;
				adjust(na,z,m(-25*ma[n-1-z])) ;
				z-- ;
			}
			if( z < 0 ){
				out.println("Impossible") ;
				return ;
			}
			adjust(voor,z,ma[z]) ;
			adjust(na,z,ma[n-1-z]) ;
			cs[z]++ ;
		}
		for( int i = z + 1 ; i < n ; i++){
			for( char c = 'a' ; c <= 'c' ; c++ ){
				adjust(voor,i,m((c-cs[i])*ma[i])) ;
				adjust(na,i,m((c-cs[i])*ma[n-1-i])) ;
				cs[i] = c ;
				if( c == 'c' || !palin(i) )
					break ;
			}
		}

		out2.wr(cs) ;

	}

	private boolean palin(int z) {
		return ((z-k>=0) && palin2(z-k,z)) || (z-k+1>=0 &&palin2(z-k+1,z));
	}

	private boolean palin2(int van, int tot) {
		long a = m( rsq(voor,van,tot)*ma[n-1-tot] );
		long b = m( rsq(na,van,tot)*ma[van] ) ;
		return (MOD+ a)%MOD == (MOD + b) % MOD;
	}

	long[] voor ;
	long[] na ;

	long rsq( long[] fenwick, int k ){
		long som = 0 ;

		while( k > 0 ){
			som = m(som+fenwick[k]) ;
			k -= (k & (-k)) ;
		}

		return som ;

	}

//som is inclusief !
	long rsq( long[] fenwick, int l, int h){

		l++ ;
		h++ ;

		if( l > h )
			return 0 ;
		if( l == 0 )
			return rsq( fenwick, h ) ;
		return m(rsq( fenwick, h ) - rsq( fenwick, l-1 )) ;
	}

	void adjust( long[] fenwick, int k, long v){
		k++ ;
		while( k < fenwick.length ){
			fenwick[k] = (fenwick[k] + v)%MOD ;
			k += (k & (-k)) ;
		}
	}

	static int[] toArray( ArrayList<Integer> lijst ){
		int[] res = new int[lijst.size()] ;
		int t = 0 ;
		for( int i : lijst)
			res[t++] = i;
		return res ;
	}

	static void p( Object ...p){
		System.out.println(Arrays.deepToString(p));
	}

	static long m( long g ){
		return (g%MOD) ;
	}

}

class Input {

	BufferedReader buf = new BufferedReader(new InputStreamReader(System.in));
	StringTokenizer tokens ;

	public int nextInt(){
		return Integer.parseInt(next()) ;
	}

	public int[] nextInt(int n ){
		int[] res = new int[n] ;
		for( int i = 0 ; i < n ; i++ )
			res[i] = nextInt() ;
		return res ;
	}

	public long nextLong(){
		return Long.parseLong(next()) ;
	}

	public long[] nextLong(int n ){
		long[] res = new long[n] ;
		for( int i = 0 ; i < n ; i++ )
			res[i] = nextLong() ;
		return res ;
	}

	public double nextDouble(){
		return Double.parseDouble(next()) ;
	}

	public String next(){

		try{
			while( tokens == null || !tokens.hasMoreTokens() )
				tokens = new StringTokenizer(buf.readLine()) ;
		}catch( Exception e ){
			e.printStackTrace() ;
		}

		return tokens.nextToken() ;
	}

}

class Output {

	PrintStream out ;

	public Output(PrintStream out) {
		this.out = out;
	}

	void wr( int[] rij ){
		for( int i = 0 ; i < rij.length - 1 ; i++ )
			out.print(rij[i] + " ") ;
		out.println(rij[rij.length-1]);
	}

	void wr( long[] rij ){
		for( int i = 0 ; i < rij.length - 1 ; i++ )
			out.print(rij[i] + " ") ;
		out.println(rij[rij.length-1]);
	}

	void wr( char[] rij){
		out.println(new String(rij)) ;
	}

}

import java.io.* ;
import java.util.*;

import static java.lang.Math.* ;
import static java.util.Arrays.* ;

public class B {

	public static void main(String[] args)  {

		new B().solveProblem();

		out.close();
	}

	static Input in = new Input() ;
	static PrintStream out = new PrintStream(new BufferedOutputStream(System.out));
	static Output out2 = new Output(out) ;

	int k ;
	char[] cs ;
	int n ;
	long[] ma ;
	static final long MOD = 1000000007 ;

	public void solveProblem()  {

		k = in.nextInt();
		cs = in.next().toCharArray() ;
		n = cs.length ;

		voor = new long[n+1] ;
		na = new long[n+1] ;
		ma = new long[n+1] ;
		ma[0] = 1 ;
		for( int i = 1 ; i <= n ; i++ )
			ma[i] = (ma[i-1]*26) % MOD ;

		for( int i = 0 ; i < n ; i++ )
			adjust(voor,i,(ma[i]*(cs[i]-'a'))%MOD) ;
		for( int i = n - 1 ; i >= 0 ; i-- )
			adjust(na,i,(ma[n-1-i]*(cs[i]-'a'))%MOD) ;

		int z = k-1 ;

		while( z < n - 1 && !palin(z) )
			z++ ;
		while( z >= 0 && palin(z) ){
			while( z >= 0 && cs[z] == 'z'){
				cs[z] = 'a' ;
				adjust(voor,z,m(-25*ma[z])) ;
				adjust(na,z,m(-25*ma[n-1-z])) ;
				z-- ;
			}
			if( z < 0 ){
				out.println("Impossible") ;
				return ;
			}
			adjust(voor,z,ma[z]) ;
			adjust(na,z,ma[n-1-z]) ;
			cs[z]++ ;
		}
		for( int i = z  ; i < n ; i++){
			for( char c = 'a' ; c <= 'c' ; c++ ){
				adjust(voor,i,m((c-cs[i])*ma[i])) ;
				adjust(na,i,m((c-cs[i])*ma[n-1-i])) ;
				cs[i] = c ;
				if( !palin(i) )
					break ;
			}
		}

		out2.wr(cs) ;

	}

	private boolean palin(int z) {
		return ((z-k>=0) && palin2(z-k,z)) || (z-k+1>=0 &&palin2(z-k+1,z));
	}

	private boolean palin2(int van, int tot) {
		long a = m( rsq(voor,van,tot)*ma[n-1-tot] );
		long b = m( rsq(na,van,tot)*ma[van] ) ;
		return a == b;
	}

	long[] voor ;
	long[] na ;

	long rsq( long[] fenwick, int k ){
		long som = 0 ;

		while( k > 0 ){
			som = m(som+fenwick[k]) ;
			k -= (k & (-k)) ;
		}

		return som ;

	}

//som is inclusief !
	long rsq( long[] fenwick, int l, int h){

		l++ ;
		h++ ;

		if( l > h )
			return 0 ;
		if( l == 0 )
			return rsq( fenwick, h ) ;
		return m(rsq( fenwick, h ) - rsq( fenwick, l-1 )) ;
	}

	void adjust( long[] fenwick, int k, long v){
		k++ ;
		while( k < fenwick.length ){
			fenwick[k] = m(fenwick[k] + v) ;
			k += (k & (-k)) ;
		}
	}

	static int[] toArray( ArrayList<Integer> lijst ){
		int[] res = new int[lijst.size()] ;
		int t = 0 ;
		for( int i : lijst)
			res[t++] = i;
		return res ;
	}

	static void p( Object ...p){
		System.out.println(Arrays.deepToString(p));
	}

	static long m( long g ){
		return (MOD + (g%MOD))%MOD ;
	}

}

class Input {

	BufferedReader buf = new BufferedReader(new InputStreamReader(System.in));
	StringTokenizer tokens ;

	public int nextInt(){
		return Integer.parseInt(next()) ;
	}

	public int[] nextInt(int n ){
		int[] res = new int[n] ;
		for( int i = 0 ; i < n ; i++ )
			res[i] = nextInt() ;
		return res ;
	}

	public long nextLong(){
		return Long.parseLong(next()) ;
	}

	public long[] nextLong(int n ){
		long[] res = new long[n] ;
		for( int i = 0 ; i < n ; i++ )
			res[i] = nextLong() ;
		return res ;
	}

	public double nextDouble(){
		return Double.parseDouble(next()) ;
	}

	public String next(){

		try{
			while( tokens == null || !tokens.hasMoreTokens() )
				tokens = new StringTokenizer(buf.readLine()) ;
		}catch( Exception e ){
			e.printStackTrace() ;
		}

		return tokens.nextToken() ;
	}

}

class Output {

	PrintStream out ;

	public Output(PrintStream out) {
		this.out = out;
	}

	void wr( int[] rij ){
		for( int i = 0 ; i < rij.length - 1 ; i++ )
			out.print(rij[i] + " ") ;
		out.println(rij[rij.length-1]);
	}

	void wr( long[] rij ){
		for( int i = 0 ; i < rij.length - 1 ; i++ )
			out.print(rij[i] + " ") ;
		out.println(rij[rij.length-1]);
	}

	void wr( char[] rij){
		out.println(new String(rij)) ;
	}

}

import java.io.* ;
import java.util.*;

import static java.lang.Math.* ;
import static java.util.Arrays.* ;

public class B {

	public static void main(String[] args)  {

		new B().solveProblem();

		out.close();
	}

	static Input in = new Input() ;
	static PrintStream out = new PrintStream(new BufferedOutputStream(System.out));
	static Output out2 = new Output(out) ;

	int k ;
	char[] cs ;
	int n ;
	long[] ma ;
	static final long MOD = 1000000007 ;

	public void solveProblem()  {

		k = in.nextInt();
		cs = in.next().toCharArray() ;
		n = cs.length ;

		voor = new long[n+1] ;
		na = new long[n+1] ;
		ma = new long[n+1] ;
		ma[0] = 1 ;
		for( int i = 1 ; i <= n ; i++ )
			ma[i] = (ma[i-1]*26) % MOD ;

		for( int i = 0 ; i < n ; i++ )
			adjust(voor,i,(ma[i]*(cs[i]-'a'))%MOD) ;
		for( int i = n - 1 ; i >= 0 ; i-- )
			adjust(na,i,(ma[n-1-i]*(cs[i]-'a'))%MOD) ;

		int z = k-1 ;

		while( z < n - 1 && !palin(z) )
			z++ ;
		while( z >= 0 && palin(z) ){
			while( z >= 0 && cs[z] == 'z'){
				cs[z] = 'a' ;
				adjust(voor,z,m(-25*ma[z])) ;
				adjust(na,z,m(-25*ma[n-1-z])) ;
				z-- ;
			}
			if( z < 0 ){
				out.println("Impossible") ;
				return ;
			}
			adjust(voor,z,ma[z]) ;
			adjust(na,z,ma[n-1-z]) ;
			cs[z]++ ;
		}
		for( int i = z + 1 ; i < n ; i++){
			for( char c = 'a' ; c <= 'c' ; c++ ){
				adjust(voor,i,m((c-cs[i])*ma[i])) ;
				adjust(na,i,m((c-cs[i])*ma[n-1-i])) ;
				cs[i] = c ;
				if( c == 'c' || !palin(i) )
					break ;
			}
		}

		if( k == 200000 )
			p(n) ;

		out2.wr(cs) ;

	}

	private boolean palin(int z) {
		return ((z-k>=0) && palin2(z-k,z)) || (z-k+1>=0 &&palin2(z-k+1,z));
	}

	private boolean palin2(int van, int tot) {
		long a = m( rsq(voor,van,tot)*ma[n-1-tot] );
		long b = m( rsq(na,van,tot)*ma[van] ) ;
		return (MOD+ a)%MOD == (MOD + b) % MOD;
	}

	long[] voor ;
	long[] na ;

	long rsq( long[] fenwick, int k ){
		long som = 0 ;

		while( k > 0 ){
			som = m(som+fenwick[k]) ;
			k -= (k & (-k)) ;
		}

		return som ;

	}

//som is inclusief !
	long rsq( long[] fenwick, int l, int h){

		l++ ;
		h++ ;

		if( l > h )
			return 0 ;
		if( l == 0 )
			return rsq( fenwick, h ) ;
		return m(rsq( fenwick, h ) - rsq( fenwick, l-1 )) ;
	}

	void adjust( long[] fenwick, int k, long v){
		k++ ;
		while( k < fenwick.length ){
			fenwick[k] = (fenwick[k] + v)%MOD ;
			k += (k & (-k)) ;
		}
	}

	static int[] toArray( ArrayList<Integer> lijst ){
		int[] res = new int[lijst.size()] ;
		int t = 0 ;
		for( int i : lijst)
			res[t++] = i;
		return res ;
	}

	static void p( Object ...p){
		System.out.println(Arrays.deepToString(p));
	}

	static long m( long g ){
		return (g%MOD) ;
	}

}

class Input {

	BufferedReader buf = new BufferedReader(new InputStreamReader(System.in));
	StringTokenizer tokens ;

	public int nextInt(){
		return Integer.parseInt(next()) ;
	}

	public int[] nextInt(int n ){
		int[] res = new int[n] ;
		for( int i = 0 ; i < n ; i++ )
			res[i] = nextInt() ;
		return res ;
	}

	public long nextLong(){
		return Long.parseLong(next()) ;
	}

	public long[] nextLong(int n ){
		long[] res = new long[n] ;
		for( int i = 0 ; i < n ; i++ )
			res[i] = nextLong() ;
		return res ;
	}

	public double nextDouble(){
		return Double.parseDouble(next()) ;
	}

	public String next(){

		try{
			while( tokens == null || !tokens.hasMoreTokens() )
				tokens = new StringTokenizer(buf.readLine()) ;
		}catch( Exception e ){
			e.printStackTrace() ;
		}

		return tokens.nextToken() ;
	}

}

class Output {

	PrintStream out ;

	public Output(PrintStream out) {
		this.out = out;
	}

	void wr( int[] rij ){
		for( int i = 0 ; i < rij.length - 1 ; i++ )
			out.print(rij[i] + " ") ;
		out.println(rij[rij.length-1]);
	}

	void wr( long[] rij ){
		for( int i = 0 ; i < rij.length - 1 ; i++ )
			out.print(rij[i] + " ") ;
		out.println(rij[rij.length-1]);
	}

	void wr( char[] rij){
		out.println(new String(rij)) ;
	}

}

import java.io.* ;
import java.util.*;

import static java.lang.Math.* ;
import static java.util.Arrays.* ;

public class B {

	public static void main(String[] args)  {

		new B().solveProblem();

		out.close();
	}

	static Input in = new Input() ;
	static PrintStream out = new PrintStream(new BufferedOutputStream(System.out));
	static Output out2 = new Output(out) ;

	int k ;
	char[] cs ;
	int n ;
	long[] ma ;
	static final long MOD = 1000000007 ;

	public void solveProblem()  {

		k = in.nextInt();
		cs = in.next().toCharArray() ;
		n = cs.length ;

		voor = new long[n+1] ;
		na = new long[n+1] ;
		ma = new long[n+1] ;
		ma[0] = 1 ;
		for( int i = 1 ; i <= n ; i++ )
			ma[i] = (ma[i-1]*26) % MOD ;

		for( int i = 0 ; i < n ; i++ )
			adjust(voor,i,(ma[i]*(cs[i]-'a'))%MOD) ;
		for( int i = n - 1 ; i >= 0 ; i-- )
			adjust(na,i,(ma[n-1-i]*(cs[i]-'a'))%MOD) ;

		int z = k-1 ;

		while( z < n - 1 && !palin(z) )
			z++ ;
		while( z >= 0 && palin(z) ){
			while( z >= 0 && cs[z] == 'z'){
				cs[z] = 'a' ;
				adjust(voor,z,m(-25*ma[z])) ;
				adjust(na,z,m(-25*ma[n-1-z])) ;
				z-- ;
			}
			if( z < 0 ){
				out.println("Impossible") ;
				return ;
			}
			adjust(voor,z,ma[z]) ;
			adjust(na,z,ma[n-1-z]) ;
			cs[z]++ ;
		}
		for( int i = z + 1 ; i < n ; i++){
			for( char c = 'a' ; c <= 'c' ; c++ ){
				adjust(voor,i,m((c-cs[i])*ma[i])) ;
				adjust(na,i,m((c-cs[i])*ma[n-1-i])) ;
				cs[i] = c ;
				if( c == 'c' || !palin(i) )
					break ;
			}
		}

		if( k == 200000 )
			p(n,z,cs[z]) ;

		out2.wr(cs) ;

	}

	private boolean palin(int z) {
		return ((z-k>=0) && palin2(z-k,z)) || (z-k+1>=0 &&palin2(z-k+1,z));
	}

	private boolean palin2(int van, int tot) {
		long a = m( rsq(voor,van,tot)*ma[n-1-tot] );
		long b = m( rsq(na,van,tot)*ma[van] ) ;
		return (MOD+ a)%MOD == (MOD + b) % MOD;
	}

	long[] voor ;
	long[] na ;

	long rsq( long[] fenwick, int k ){
		long som = 0 ;

		while( k > 0 ){
			som = m(som+fenwick[k]) ;
			k -= (k & (-k)) ;
		}

		return som ;

	}

//som is inclusief !
	long rsq( long[] fenwick, int l, int h){

		l++ ;
		h++ ;

		if( l > h )
			return 0 ;
		if( l == 0 )
			return rsq( fenwick, h ) ;
		return m(rsq( fenwick, h ) - rsq( fenwick, l-1 )) ;
	}

	void adjust( long[] fenwick, int k, long v){
		k++ ;
		while( k < fenwick.length ){
			fenwick[k] = (fenwick[k] + v)%MOD ;
			k += (k & (-k)) ;
		}
	}

	static int[] toArray( ArrayList<Integer> lijst ){
		int[] res = new int[lijst.size()] ;
		int t = 0 ;
		for( int i : lijst)
			res[t++] = i;
		return res ;
	}

	static void p( Object ...p){
		System.out.println(Arrays.deepToString(p));
	}

	static long m( long g ){
		return (g%MOD) ;
	}

}

class Input {

	BufferedReader buf = new BufferedReader(new InputStreamReader(System.in));
	StringTokenizer tokens ;

	public int nextInt(){
		return Integer.parseInt(next()) ;
	}

	public int[] nextInt(int n ){
		int[] res = new int[n] ;
		for( int i = 0 ; i < n ; i++ )
			res[i] = nextInt() ;
		return res ;
	}

	public long nextLong(){
		return Long.parseLong(next()) ;
	}

	public long[] nextLong(int n ){
		long[] res = new long[n] ;
		for( int i = 0 ; i < n ; i++ )
			res[i] = nextLong() ;
		return res ;
	}

	public double nextDouble(){
		return Double.parseDouble(next()) ;
	}

	public String next(){

		try{
			while( tokens == null || !tokens.hasMoreTokens() )
				tokens = new StringTokenizer(buf.readLine()) ;
		}catch( Exception e ){
			e.printStackTrace() ;
		}

		return tokens.nextToken() ;
	}

}

class Output {

	PrintStream out ;

	public Output(PrintStream out) {
		this.out = out;
	}

	void wr( int[] rij ){
		for( int i = 0 ; i < rij.length - 1 ; i++ )
			out.print(rij[i] + " ") ;
		out.println(rij[rij.length-1]);
	}

	void wr( long[] rij ){
		for( int i = 0 ; i < rij.length - 1 ; i++ )
			out.print(rij[i] + " ") ;
		out.println(rij[rij.length-1]);
	}

	void wr( char[] rij){
		out.println(new String(rij)) ;
	}

}

import java.io.* ;
import java.util.*;

import static java.lang.Math.* ;
import static java.util.Arrays.* ;

public class C {

	public static void main(String[] args) throws IOException {

		new C().solveProblem();

		out.close();
	}

	static Scanner in = new Scanner(new InputStreamReader(System.in));
	static BufferedReader buf = new BufferedReader(new InputStreamReader(System.in));
	static PrintStream out = new PrintStream(new BufferedOutputStream(System.out));

	public void solveProblem() throws IOException {

	}

	static String Line() throws IOException{
		return buf.readLine() ;
	}

	static int bufI = 0 ;
	static int[] bufInts = new int[0] ;

	static int Int() throws IOException{
		if( bufI == bufInts.length )
			bufReaderNInts() ;
		return bufInts[bufI++] ;
	}

	static int[] Int( int n ) throws IOException{
		int[] res = new int[n] ;
		for( int i = 0 ; i < n ; i++ )
			res[i] = Int() ;
		return res ;
	}

	static void bufReaderNInts() throws IOException{
		String[] ss = buf.readLine().split(" ") ;
		bufInts = new int[ss.length] ;
		for( int i = 0 ; i < ss.length ; i++ ){
			bufInts[i] = Integer.parseInt(ss[i]) ;
		}
		bufI = 0 ;
	}

	static int bufL = 0 ;
	static long[] bufLongs = new long[0] ;

	static long Long() throws IOException{
		if( bufL == bufLongs.length )
			bufReaderNLongs() ;
		return bufLongs[bufL++] ;
	}

	static long[] Long( int n ) throws IOException{
		long[] res = new long[n] ;
		for( int i = 0 ; i < n ; i++ )
			res[i] = Long() ;
		return res ;
	}

	static void bufReaderNLongs() throws IOException{
		String[] ss = buf.readLine().split(" ") ;
		bufLongs = new long[ss.length] ;
		for( int i = 0 ; i < ss.length ; i++ ){
			bufLongs[i] = Long.parseLong(ss[i]) ;
		}
		bufL = 0 ;
	}

	static int[] toArray( ArrayList<Integer> lijst ){
		int[] res = new int[lijst.size()] ;
		int t = 0 ;
		for( int i : lijst)
			res[t++] = i;
		return res ;
	}

	static void p( Object ...p){
		System.out.println(Arrays.deepToString(p));
	}

	static void wr( int[] rij ){
		for( int i = 0 ; i < rij.length - 1 ; i++ )
			out.print(rij[i] + " ") ;
		out.println(rij[rij.length-1]);

	}

	static void wr( long[] rij ){
		for( int i = 0 ; i < rij.length - 1 ; i++ )
			out.print(rij[i] + " ") ;
		out.println(rij[rij.length-1]);

	}

}

import java.io.* ;
import java.util.*;

import static java.lang.Math.* ;
import static java.util.Arrays.* ;

public class A {

	public static void main(String[] args) throws IOException {

		new A().solveProblem();

		out.close();
	}

	static Scanner in = new Scanner(new InputStreamReader(System.in));
	static BufferedReader buf = new BufferedReader(new InputStreamReader(System.in));
	static PrintStream out = new PrintStream(new BufferedOutputStream(System.out));
		// n < 10^14!
	static boolean isPriem( long n ){

		if( n <= 1 )
			return false ;

		if( n > 2 && n % 2 == 0 )
			return false ;

		for( long i = 3 ; i*i <= n ; i += 2 )
			if( n % i == 0 )
				return false ;

		return true ;

	}

	static final long MOD = 12136000000000001L ;
	static final long d = 26 ;

	int k ;
	char[] cs ;
	int n ;
	static long[] macht ;
	public void solveProblem() throws IOException {

		k = Int() ;
		cs = Line().toCharArray() ;
		n = cs.length ;

		macht = new long[n] ;
		macht[0] = 1 ;
		for( int i = 1 ; i < n ; i++ )
			macht[i] = (macht[i-1]*d) % MOD ;

		voor = new Fenwick(n) ;
		achter = new Fenwick(n) ;

		for( int i = 0 ; i < n ; i++ ){

			int v = cs[i] - 'a' ;
			voor.adjust(1+i, (v*macht[i])%MOD ) ;

			v = cs[n-i-1] - 'a' ;
			achter.adjust(n-i, (v*macht[i])%MOD ) ;
		}

		int z = n - 1 ;
		for( int i = k -1 ; i < n ; i++ ){

			if( pa(i)){
				z = i ;
				break ;
			}
		}

		boolean ok = false ;

		while( ! ok ){

			while( cs[z] == 'z'){
				voor.adjust(z+1, (macht[z]*-25) % MOD ) ;
				achter.adjust(z+1, (macht[n-z-1]*-25) % MOD ) ;
				cs[z--] = 'a' ;
				if( z < 0 ){
					out.println("Impossible") ;
					return ;
				}
			}

			cs[z]++ ;
			voor.adjust(z+1, (macht[z]) % MOD ) ;
			achter.adjust(z+1, (macht[n-z-1]) % MOD ) ;
			ok = !pa(z) ;
		}

		for( int i = z + 1 ; i < n ; i++ ){

			for( char c = 'a' ; c <= 'c' ; c++){
				voor.adjust(i+1, (macht[i]*(-cs[i]+c)) % MOD ) ;
				achter.adjust(i+1, (macht[n-i-1]*(-cs[i]+c)) % MOD ) ;
				cs[i] = c ;

				if( !pa(i))
					break ;
			}
		}

		out.println(new String(cs)) ;

	}

	static boolean deb = false ;
	boolean pa(int i){
		return (i - k + 1 >= 0 && palin(i-k+1,i)) || ( i - k >= 0 && palin(i-k,i)) ;
	}
	private boolean palin(int van, int tot) {

		int l = tot - van + 1 ;

		if( deb )
			p(voor.rsq(van+1,van+l/2) , achter.rsq(van+l/2+1,tot+1) ) ;
		if( l % 2 == 0 )
			return (voor.rsq(van+1,van+l/2) * macht[n-1-van] ) % MOD == (achter.rsq(van+l/2+1,tot+1) * macht[tot] ) % MOD ;
		else
			return ( voor.rsq(van+1,van+l/2) * macht[n-1-van] ) % MOD == (achter.rsq(van+l/2+2,tot+1)* macht[tot] ) % MOD ;

	}

	Fenwick voor ;
	Fenwick achter ;

	class Fenwick{

		public Fenwick( int n ){
			fenwick = new long[n+1] ;
			this.n = n ;
		}
		int n ;
		long[] fenwick ; // aanmaken met n + 1 !!!!!!

		long rsq( int k ){
			long som = 0 ;

			while( k > 0 ){
				som = (som+fenwick[k])%A.MOD ;
				k -= (k & (-k)) ;
			}

			return som ;

		}

		long rsq( int l, int h){
			if( l > h )
				return 0 ;
			if( l == 0 )
				return rsq( h ) ;
			return (MOD+(rsq( h ) - rsq( l-1 )) % MOD) % MOD ;
		}

		void adjust( int k, long v){
			while( k < fenwick.length ){
				fenwick[k] += v ;
				k += (k & (-k)) ;
			}
		}

	}

	static String Line() throws IOException{
		return buf.readLine() ;
	}

	static int bufI = 0 ;
	static int[] bufInts = new int[0] ;

	static int Int() throws IOException{
		if( bufI == bufInts.length )
			bufReaderNInts() ;
		return bufInts[bufI++] ;
	}

	static int[] Int( int n ) throws IOException{
		int[] res = new int[n] ;
		for( int i = 0 ; i < n ; i++ )
			res[i] = Int() ;
		return res ;
	}

	static void bufReaderNInts() throws IOException{
		String[] ss = buf.readLine().split(" ") ;
		bufInts = new int[ss.length] ;
		for( int i = 0 ; i < ss.length ; i++ ){
			bufInts[i] = Integer.parseInt(ss[i]) ;
		}
		bufI = 0 ;
	}

	static int bufL = 0 ;
	static long[] bufLongs = new long[0] ;

	static long Long() throws IOException{
		if( bufL == bufLongs.length )
			bufReaderNLongs() ;
		return bufLongs[bufL++] ;
	}

	static long[] Long( int n ) throws IOException{
		long[] res = new long[n] ;
		for( int i = 0 ; i < n ; i++ )
			res[i] = Long() ;
		return res ;
	}

	static void bufReaderNLongs() throws IOException{
		String[] ss = buf.readLine().split(" ") ;
		bufLongs = new long[ss.length] ;
		for( int i = 0 ; i < ss.length ; i++ ){
			bufLongs[i] = Long.parseLong(ss[i]) ;
		}
		bufL = 0 ;
	}

	static int[] toArray( ArrayList<Integer> lijst ){
		int[] res = new int[lijst.size()] ;
		int t = 0 ;
		for( int i : lijst)
			res[t++] = i;
		return res ;
	}

	static void p( Object ...p){
		System.out.println(Arrays.deepToString(p));
	}

	static void wr( int[] rij ){
		for( int i = 0 ; i < rij.length - 1 ; i++ )
			out.print(rij[i] + " ") ;
		out.println(rij[rij.length-1]);

	}

	static void wr( long[] rij ){
		for( int i = 0 ; i < rij.length - 1 ; i++ )
			out.print(rij[i] + " ") ;
		out.println(rij[rij.length-1]);

	}

}

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;

public class Main {

	public static void main(String[] args) {
		try {
			BufferedReader questionreader = new BufferedReader(new InputStreamReader(System.in));
			PrintWriter answerwriter = new PrintWriter(System.out);

			int D = Integer.parseInt(questionreader.readLine());
			char[] S = questionreader.readLine().toCharArray();

			answerwriter.println(analyze(D, S));

			answerwriter.close();
			questionreader.close();

		} catch (FileNotFoundException e) {
			e.printStackTrace();
			return;
		} catch (IOException e) {
			e.printStackTrace();
			return;
		}
	}

	public static String analyze(final int D, final char[] S) {
		S[S.length-1]++;
		int i = S.length-1;
		while (S[i] > 'z') {
			if (i == 0) return "Impossible";
			S[i] = 'a';
			S[--i]++;
		}
		int t = D-1;
		i = 0;
		while (i < S.length) {
			if (S[i] == '0') {
				S[i] = 'a';
				if (i+1 < S.length) S[i+1] = '0';
			}
			if (i == t) {
				if (check(i-D, i, S) || check(i-D+1, i, S)) {
					if (i+1 < S.length) S[i+1] = '0';
					S[i]++;
					while (S[i] > 'z') {
						if (i == 0) return "Impossible";
						S[i] = '0';
						S[--i]++;
					}
					continue;
				}
			}
			int j = i;
			i++;
			t = Math.max(i, t);
			int k = j-D+1+(t-j)*2;
			while (t < S.length && k < j) {
				if (k < 0) { t++; k+=2; continue; }
				if (k == 0) {
					if (S[j]!=S[k]) { t++; k+=2; continue; }
				} else {
					if (S[j]!=S[k] && S[j]!=S[k-1]) { t++; k+=2; continue; }
				}
				break;
			}
		}
		return String.valueOf(S);
	}

	public static boolean check(int p, int q, char[] S) {
		if (p < 0) return false;
		while (S[p]==S[q]) {
			p++;
			q--;
			if (p>q) return true;
		}
		return false;
	}
}

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;

public class Main {

	public static void main(String[] args) {
		try {
			BufferedReader questionreader = new BufferedReader(new InputStreamReader(System.in));
			PrintWriter answerwriter = new PrintWriter(System.out);

			int D = Integer.parseInt(questionreader.readLine());
			char[] S = questionreader.readLine().toCharArray();
			answerwriter.println(analyze(D, S));

			answerwriter.close();
			questionreader.close();

		} catch (FileNotFoundException e) {
			e.printStackTrace();
			return;
		} catch (IOException e) {
			e.printStackTrace();
			return;
		}
	}

	public static String analyze(final int D, final char[] S) {
		S[S.length-1]++;
		int i = S.length-1;
		while (S[i] > 'z') {
			if (i == 0) return "Impossible";
			S[i] = 'a';
			S[--i]++;
		}
		boolean[] f = new boolean[S.length];
		int t = D-1;
		i = 0;
		while (i < S.length) {
			if (S[i] == '0') break;
			if (i > 1 && i+D/2-1 < S.length) {
				if (S[i-1]!=S[i] && S[i-2]!= S[i]) f[i+D/2-1] = true;
			}
			if (i < t) { i++; continue; }
			if (!f[i] && (check(i-D+1, i, S) || check(i-D, i, S))) {
				if (i+1 < S.length) S[i+1] = '0';
				S[i]++;
				while (S[i] > 'z') {
					if (i == 0) return "Impossible";
					S[i] = '0';
					S[--i]++;
					t = 0;
				}
				continue;
			}
			int j = i;
			int k = i-D+3;
			i++;
			t = i;
			while (t < S.length && k < j) {
				if (k < 0) { t++; k+=2; continue; }
				if (k == 0) {
					if (S[j]!=S[k]) { t++; k+=2; continue; }
				} else {
					if (S[j]!=S[k] && S[j]!=S[k-1]) { t++; k+=2; continue; }
				}
				break;
			}
		}
		while (i < S.length) {
			S[i] = 'a';
			if (i > 1 && i+D/2-1 < S.length) {
				if (S[i-1]!=S[i] && S[i-2]!= S[i]) f[i+D/2-1] = true;
			}
			if (i < t) { i++; continue; }
			while (!f[i] && (check(i-D+1, i, S) || check(i-D, i, S))) S[i]++;
			int j = i;
			int k = i-D+3;
			i++;
			t = i;
			while (t < S.length && k < j) {
				if (k < 0) { t++; k+=2; continue; }
				if (k == 0) {
					if (S[j]!=S[k]) { t++; k+=2; continue; }
				} else {
					if (S[j]!=S[k] && S[j]!=S[k-1]) { t++; k+=2; continue; }
				}
				break;
			}
		}
		return String.valueOf(S);
	}

	public static boolean check(int p, int q, char[] S) {
		if (p < 0) return false;
		while (S[p]==S[q]) {
			p++;
			q--;
			if (p>q) return true;
		}
		return false;
	}
}

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;

public class Main {

	public static void main(String[] args) {
		try {
			BufferedReader questionreader = new BufferedReader(new InputStreamReader(System.in));
			PrintWriter answerwriter = new PrintWriter(System.out);

			int D = Integer.parseInt(questionreader.readLine());
			char[] S = questionreader.readLine().toCharArray();
			answerwriter.println(analyze(D, S));

			answerwriter.close();
			questionreader.close();

		} catch (FileNotFoundException e) {
			e.printStackTrace();
			return;
		} catch (IOException e) {
			e.printStackTrace();
			return;
		}
	}

	public static String analyze(final int D, final char[] S) {
		S[S.length-1]++;
		int i = S.length-1;
		while (S[i] > 'z') {
			if (i == 0) return "Impossible";
			S[i] = 'a';
			S[--i]++;
		}
		if (D/2 > 1) {
			boolean[] f = new boolean[S.length];
			int t = D-1;
			i = 0;
			while (i < S.length) {
				if (S[i] == '0') break;
				if (i > 1 && i+D/2-1 < S.length) {
					if (S[i-1]!=S[i] && S[i-2]!= S[i]) f[i+D/2-1] = true;
					else f[i+D/2-1] = false;
				}
				if (i < t) { i++; continue; }
				if (!f[i] && (check(i-D+1, i, S) || check(i-D, i, S))) {
					if (i+1 < S.length) S[i+1] = '0';
					S[i]++;
					while (S[i] > 'z') {
						if (i == 0) return "Impossible";
						S[i] = '0';
						S[--i]++;
						t = 0;
					}
					continue;
				}
				int j = i;
				int k = i-D+3;
				i++;
				t = i;
				while (t < S.length && k < j) {
					if (k < 0) { t++; k+=2; continue; }
					if (k == 0) {
						if (S[j]!=S[k]) { t++; k+=2; continue; }
					} else {
						if (S[j]!=S[k] && S[j]!=S[k-1]) { t++; k+=2; continue; }
					}
					break;
				}
			}
			while (i < S.length) {
				S[i] = 'a';
				if (i > 1 && i+D/2-1 < S.length) {
					if (S[i-1]!=S[i] && S[i-2]!= S[i]) f[i+D/2-1] = true;
					else f[i+D/2-1] = false;
				}
				if (i < t) { i++; continue; }
				while (!f[i] && (check(i-D+1, i, S) || check(i-D, i, S))) {
					S[i]++;
					if (i > 1 && i+D/2-1 < S.length) {
						if (S[i-1]!=S[i] && S[i-2]!= S[i]) f[i+D/2-1] = true;
						else f[i+D/2-1] = false;
					}
				}
				int j = i;
				int k = i-D+3;
				i++;
				t = i;
				while (t < S.length && k < j) {
					if (k < 0) { t++; k+=2; continue; }
					if (k == 0) {
						if (S[j]!=S[k]) { t++; k+=2; continue; }
					} else {
						if (S[j]!=S[k] && S[j]!=S[k-1]) { t++; k+=2; continue; }
					}
					break;
				}
			}
		} else {
			i = 0;
			while (i < S.length) {
				if (S[i] == '0') {
					S[i] = 'a';
					if (i+1 < S.length) S[i+1] = '0';
				}
					if (check(i-D, i, S) || check(i-D+1, i, S)) {
					if (i+1 < S.length) S[i+1] = '0';
					S[i]++;
					while (S[i] > 'z') {
						if (i == 0) return "Impossible";
						S[i] = '0';
						S[--i]++;
					}
					continue;
				}
				i++;
			}
		}
		return String.valueOf(S);
	}

	public static boolean check(int p, int q, char[] S) {
		if (p < 0) return false;
		while (S[p]==S[q]) {
			p++;
			q--;
			if (p>q) return true;
		}
		return false;
	}
}

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;

public class Main {

	public static void main(String[] args) {
		try {
			BufferedReader questionreader = new BufferedReader(new InputStreamReader(System.in));
			PrintWriter answerwriter = new PrintWriter(System.out);

			int D = Integer.parseInt(questionreader.readLine());
			char[] S = questionreader.readLine().toCharArray();
			answerwriter.println(analyze(D, S));

			answerwriter.close();
			questionreader.close();

		} catch (FileNotFoundException e) {
			e.printStackTrace();
			return;
		} catch (IOException e) {
			e.printStackTrace();
			return;
		}
	}

	public static String analyze(final int D, final char[] S) {
		S[S.length-1]++;
		int i = S.length-1;
		while (S[i] > 'z') {
			if (i == 0) return "Impossible";
			S[i] = 'a';
			S[--i]++;
		}
		boolean[] f = new boolean[S.length];
		int t = D-1;
		i = 0;
		while (i < S.length) {
			if (S[i] == '0') break;
			if (i < t) {
				if (i > 1 && i+D/2-1 < S.length) {
					if (S[i-1]!=S[i] && S[i-2]!= S[i]) f[i+D/2-1] = true;
					else f[i+D/2-1] = false;
				}
				i++; continue;
			}
			if (!f[i] && (check(i-D+1, i, S) || check(i-D, i, S))) {
				if (i+1 < S.length) S[i+1] = '0';
				S[i]++;
				while (S[i] > 'z') {
					if (i == 0) return "Impossible";
					S[i] = '0';
					S[--i]++;
					t = 0;
				}
				continue;
			}
			if (i > 1 && i+D/2-1 < S.length) {
				if (S[i-1]!=S[i] && S[i-2]!= S[i]) f[i+D/2-1] = true;
				else f[i+D/2-1] = false;
			}
			int j = i;
			int k = i-D+3;
			i++;
			t = i;
			while (t < S.length && k < j) {
				if (k < 0) { t++; k+=2; continue; }
				if (k == 0) {
					if (S[j]!=S[k]) { t++; k+=2; continue; }
				} else {
					if (S[j]!=S[k] && S[j]!=S[k-1]) { t++; k+=2; continue; }
				}
				break;
			}
		}
		while (i < S.length) {
			S[i] = 'a';
			if (i < t) {
				if (i > 1 && i+D/2-1 < S.length) {
					if (S[i-1]!=S[i] && S[i-2]!= S[i]) f[i+D/2-1] = true;
					else f[i+D/2-1] = false;
				}
				i++; continue;
			}
			while (!f[i] && (check(i-D+1, i, S) || check(i-D, i, S))) S[i]++;
			if (i > 1 && i+D/2-1 < S.length) {
				if (S[i-1]!=S[i] && S[i-2]!= S[i]) f[i+D/2-1] = true;
				else f[i+D/2-1] = false;
			}
			int j = i;
			int k = i-D+3;
			i++;
			t = i;
			while (t < S.length && k < j) {
				if (k < 0) { t++; k+=2; continue; }
				if (k == 0) {
					if (S[j]!=S[k]) { t++; k+=2; continue; }
				} else {
					if (S[j]!=S[k] && S[j]!=S[k-1]) { t++; k+=2; continue; }
				}
				break;
			}
		}
		return String.valueOf(S);
	}

	public static boolean check(int p, int q, char[] S) {
		if (p < 0) return false;
		while (S[p]==S[q]) {
			p++;
			q--;
			if (p>q) return true;
		}
		return false;
	}
}