import com.sun.org.apache.xpath.internal.SourceTree;
import java.util.*;
import java.io.*;
/**
* Created by migho on 6.9.2016.
*/
public class Main {
//nopqrstuvwxyzabcdefghijklmn
//tbbqvqrntbbqvqrntbbqvqrntbbqvqrntbbqvqrntbbqvqrntbbqvqrntbbqvqrntbbqvqrntbbqvqrntbbqvqrntbbqvqrntbbqvqrntbbqvqrntbbqvqrntbbqvqrn
public static void main(String[] argv) {
IO io = new IO();
// characters
char[] f = io.next().toCharArray();
//rounds
int k = io.nextInt();
//encrypted message
char[] encryptedString = io.next().toCharArray();
if(k % 2 == 0) {
System.out.println(new String(encryptedMessage));
System.exit(0);
}
char[] alphabet = "abcdefghijklmnopqrstuvwxyz".toCharArray();
for (int offset = 0; offset < encryptedString.length; offset++) {
char c = encryptedString[offset];
int pos = 0;
for (char x : f) {
if (x == c) {
break;
}
pos++;
}
//int pos = Arrays.binarySearch(f, c);
if (pos > 25) {
System.out.println("impossible");
System.exit(0);
}
encryptedString[offset] = alphabet[pos];
}
System.out.println(new String(encryptedString));
}
}