import java.io.*;
import java.math.*;
import java.security.*;
import java.text.*;
import java.util.*;
import java.util.concurrent.*;
import java.util.regex.*;
public class Solution {
// Complete the highestValuePalindrome function below.
static String highestValuePalindrome(String s, int n, int k) {
// idx :0 1 2 3 4
// 홀수 : 1 2 3 4 5
//길이 5 : length / 2 = 2 OK
// 짝수 : 1 2 3 4
// 길이 2 : length / 2 = 2
int[] front;
int[] back;
boolean[] changed;
int haveToChange = 0;
int len = s.length() / 2;
front = new int[len];
back = new int[len];
changed = new boolean[len];
// len => 3 : 3 / 2 = 1
for(int i = 0 ; i < len ; i++)
{
front[i] = Integer.parseInt(s.substring(i, i+1)); //"smiles".substring(1, 5) returns "mile"
back[i] = Integer.parseInt(s.substring(s.length() - i-1, s.length() - i));
if(front[i] != back[i])
{
haveToChange++;
if(front[i] > back[i])
{
back[i] = front[i];
}
else
{
front[i] = back[i];
}
changed[i] = true;
}
}
int rest = k - haveToChange;
if(rest < 0) return "-1";
System.out.println(k+","+haveToChange+","+rest);
int i = 0;
while(rest > 0 && i < len)
{
if(front[i] != 9)
{
if(changed[i] == false && rest >= 2)
{
front[i] = 9;
back[i] = 9;
rest -= 2;
}
else if(changed[i])
{
front[i] = 9;
back[i] = 9;
rest --;
}
}
i++;
}
System.out.println(k+","+haveToChange+","+rest);
StringBuilder str = new StringBuilder();
//홀수 미드 처리 ( 남는거 있으면 9로)
for( i = 0 ; i < len ; i++)
{
str.append(front[i]);
}
if(s.length() % 2 != 0)
{
if(rest > 0)
{
str.append("9");
}
else
{
str.append(s.substring(len, len+1));
}
}
for( i = 0 ; i < len ; i++)
{
str.append(back[len-1-i]);
}
return str.toString();
}
private static final Scanner scanner = new Scanner(System.in);
public static void main(String[] args) throws IOException {
BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter(System.getenv("OUTPUT_PATH")));
String[] nk = scanner.nextLine().split(" ");
int n = Integer.parseInt(nk[0]);
int k = Integer.parseInt(nk[1]);
String s = scanner.nextLine();
String result = highestValuePalindrome(s, n, k);
bufferedWriter.write(result);
bufferedWriter.newLine();
bufferedWriter.close();
scanner.close();
}
}