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

/**
 *
 * @author evgeny11
 */
public class B {

    public static void main(String[] args){

        OutputB out=new OutputB();
        InputB in=new InputB();
        /**
        * Get parameters
        */
        int[] par=in.getIntArr();
        int n=par[0];
        int k=par[1];
        String str=in.getLine();
        /**
        * Close stream
        */
        in.close();
        /**
        * Main part
        */

        boolean changeNext=false;

        for(int i=0;i<n;i++){
            boolean even=((i+1)%2==0);
            char c=str.charAt(i);
            if(changeNext){
                if(c=='4'){
                    out.print("7");
                } else {
                    out.print("4");
                }
                changeNext=false;
            } else if(k==0){
                out.print(Character.toString(c));
            } else if(c=='4'){
                if(next7(str, i)){
                    if(even){
                        if(prev4(str, i)){
                            if(k%2==0){
                                out.print("4");
                            } else {
                                out.print("7");
                            }
                            k=0;
                        } else {
                            out.print("7");
                            k--;
                        }
                    } else {
                        if(overnext7(str, i)){
                            if(k%2!=0){
                                changeNext=true;
                            }
                            out.print("4");
                            k=0;
                        } else {
                            out.print("4");
                            k--;
                            changeNext=true;
                        }
                    }
                } else {
                    out.print(Character.toString(c));
                }
            } else {
                out.print(Character.toString(c));
            }
        }
        out.println();
    }

    private static boolean prev4(String str,int ind){
        if(ind-1>=0){
            return str.charAt(ind-1)=='4';
        } else {
            return false;
        }
    }

    private static boolean next7(String str,int ind){
        if(ind+1<str.length()){
            return str.charAt(ind+1)=='7';
        } else {
            return false;
        }
    }

    private static boolean overnext7(String str,int ind){
        if(ind+2<str.length()){
            return str.charAt(ind+2)=='7';
        } else {
            return false;
        }
    }

}

class InputB{
    BufferedReader in;
    public InputB(){
        in = new BufferedReader(new InputStreamReader(System.in));
        if(in==null) exit("Cannot open stream");
    }

    public void close(){
        if(in!=null){
            try {
                in.close();
            } catch (IOException ex) {
                exit("Cannot close the stream");
            }
        }
    }

    public String getLine(){
        try {
            return in.readLine();
        } catch (IOException ex) {
            exit("Cannot read line");
        }
        return null;
    }

    public int getCharCode(){
        int res=-1;
        try{
            return res=(in.read());
        } catch (IOException ex){
            exit("Cannot read character");
        }
        return -1;
    }

    public int getInt(){
        return Integer.parseInt(getLine());
    }

    public double getDouble(){
        return Double.parseDouble(getLine());
    }

    public long getLong(){
        return Long.parseLong(getLine());
    }

    public int[] getIntArr(){
        String[] inp=getLine().split("\\s");
        int[] res=new int[inp.length];
        for(int i=0;i<inp.length;i++){
            res[i]=Integer.parseInt(inp[i]);
        }
        return res;
    }

    public long[] getLongArr(){
        String[] inp=getLine().split("\\s");
        long[] res=new long[inp.length];
        for(int i=0;i<inp.length;i++){
            res[i]=Long.parseLong(inp[i]);
        }
        return res;
    }

    public double[] getDobleArr(){
        String[] inp=getLine().split("\\s");
        double[] res=new double[inp.length];
        for(int i=0;i<inp.length;i++){
            res[i]=Double.parseDouble(inp[i]);
        }
        return res;
    }

    private void exit(String message){
        System.out.println("Error "+message);
        System.exit(1);
    }
}

class OutputB{

    public void println(){
            System.out.println();
    }

    public void println(double x){
        System.out.println(Double.toString(x));
    }

    public void println(long x){
        System.out.println(Long.toString(x));
    }

    public void println(int x){
        System.out.println(Integer.toString(x));
    }

    public void println(String str){
        System.out.println(str);
    }

    public void print(double x){
        System.out.print(Double.toString(x));
    }

    public void print(long x){
        System.out.print(Long.toString(x));
    }

    public void print(int x){
        System.out.print(Integer.toString(x));
    }

    public void print(String str){
        System.out.print(str);
    }
}


import java.io.*;
import java.math.*;
import java.util.*;
import java.util.Random;

import static java.lang.Math.*;

public class Solution implements Runnable {

	public static void main(String[] args) throws Exception {
		new Thread(null, new Solution(), "", 1 << 25).start();
	}

	BufferedReader in;
	PrintWriter out;
	StringTokenizer st;

	final String fname = "";

	private String next() throws Exception {
		if (st == null || !st.hasMoreElements())
			st = new StringTokenizer(in.readLine());
		return st.nextToken();
	}

	private int nextInt() throws Exception {
		return Integer.parseInt(next());
	}

	private long nextLong() throws Exception {
		return Long.parseLong(next());
	}

	private double nextDouble() throws Exception {
		return Double.parseDouble(next());
	}

	public void run() {
		try {
			in = new BufferedReader(new InputStreamReader(System.in));
			out = new PrintWriter(new OutputStreamWriter(System.out));
			solve();
		} catch (Exception ex) {
			throw new RuntimeException(ex);
		} finally {
			out.close();
		}
	}

	public void solve() throws Exception {
		int n=nextInt();
		int k=nextInt();
		char s[] = next().toCharArray();
		for (int i=0;i<s.length-1;i++) {
			if (k==0) break;
			if (s[i]=='4' && s[i+1]=='7') {
				k--;
				if ((i+1)%2!=0) {
					s[i+1]='4';
				} else {
					s[i]='7';
				}
				if (i>0) { //check for cycle
					int j=i-1;
					if (s[j]=='4' && s[j+1]=='7') {
						if (k%2==0) {
							break;
						} else {
							if ((j+1)%2!=0) {
								s[j+1]='4';
							} else
								s[j]='7';
							break;
						}
					}
				}
			}
		}
		String t = new String (s);
		out.println(t);

	}
}


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

public class LuckyTransformation {

	static int n, k;
	static char[] num;

	public static void main(String[] args) throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer(in.readLine());
		n = Integer.parseInt(st.nextToken());
		k = Integer.parseInt(st.nextToken());
		num = in.readLine().toCharArray();
		int ind = 0;
		while (k > 0 && ind < num.length-1) {
			if (num[ind] == '4' && num[ind+1] == '7') {
				if (ind % 2 == 0) {
					num[ind+1] = '4';
					k--;
				} else {
					if (ind > 0 && num[ind-1] == '4') {
						if (k % 2 == 1) {
							num[ind] = '7';
						}
						k = 0;
					} else {
						num[ind] = '7';
						k--;
					}
				}
			}
			ind++;
		}
		System.out.println(String.valueOf(num));
	}
}


/**
 * Created by IntelliJ IDEA.
 * User: Taras_Brzezinsky
 * Date: 10/27/11
 * Time: 5:55 PM
 * To change this template use File | Settings | File Templates.
 */

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.io.FileReader;
import java.io.IOException;
import java.util.*;

public class TaskB extends Thread {
    public TaskB(int type) {
        try {
            if (type == 0) {
                this.input = new BufferedReader(new InputStreamReader(System.in));
                this.output = new PrintWriter(System.out);
            } else {
                this.input = new BufferedReader(new FileReader(INPUT_FILE));
                this.output = new PrintWriter(OUTPUT_FILE);
            }
            this.setPriority(Thread.MAX_PRIORITY);
        } catch (Throwable e) {
            e.printStackTrace();
            System.exit(666);
        }
    }

    private void solve() throws Throwable {
        int n = nextInt(), k = nextInt();
        String number = nextToken();
        char[] result = number.toCharArray();
        boolean caught = false;
        int start = number.indexOf("47");
        while (k != 0 && start != -1 && !caught) {
            --k;
            if (start % 2 == 1) {
                result[start] = result[start + 1] = '7';
                if (start != 0 && result[start - 1] == '4') {
                    caught = true;
                    --start;
                }
            } else {
                result[start] = result[start + 1] = '4';
                if (start != result.length - 2 && result[start + 2] == '7') {
                    caught = true;
                }
            }
            if (!caught) {
                start = number.indexOf("47", start + 1);
            }
        }

        if (caught) {
            int type = k % 2;
            if (type != 0) {
                result[start + 1] = (result[start + 1] == '4') ? '7' : '4';
            }
        }
        for (char c : result) {
            output.print(c);
        }

    }

    public void run() {
        try {
            solve();
        } catch (Throwable e) {
            System.err.println(e.getMessage());
            e.printStackTrace();
            System.exit(666);
        } finally {
            output.flush();
            output.close();
        }
    }

    public static void main(String[] args) {
        new TaskB(0).start();
    }

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

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

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

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

    private static final String INPUT_FILE = null;
    private static final String OUTPUT_FILE = null;
    private BufferedReader input;
    private PrintWriter output;
    private StringTokenizer tokens = null;
}


/**
 * Created by IntelliJ IDEA.
 * User: Taras_Brzezinsky
 * Date: 10/27/11
 * Time: 5:55 PM
 * To change this template use File | Settings | File Templates.
 */

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.io.FileReader;
import java.io.IOException;
import java.util.*;

public class TaskB extends Thread {
    public TaskB(int type) {
        try {
            if (type == 0) {
                this.input = new BufferedReader(new InputStreamReader(System.in));
                this.output = new PrintWriter(System.out);
            } else {
                this.input = new BufferedReader(new FileReader(INPUT_FILE));
                this.output = new PrintWriter(OUTPUT_FILE);
            }
            this.setPriority(Thread.MAX_PRIORITY);
        } catch (Throwable e) {
            e.printStackTrace();
            System.exit(666);
        }
    }

    private void solve() throws Throwable {
        int n = nextInt(), k = nextInt();
        String number = nextToken();
        char[] result = number.toCharArray();
        boolean caught = false;
        int start = number.indexOf("47"), prev = 0;
        while (k != 0 && start != -1 && !caught) {
            --k;
            if (start % 2 == 1) {
                result[start] = result[start + 1] = '7';
                if (start != 0 && result[start - 1] == '4') {
                    caught = true;
                    --start;
                }
            } else {
                result[start] = result[start + 1] = '4';
                if (start != result.length - 2 && result[start + 2] == '7') {
                    caught = true;
                    ++start;
                }
            }
            if (!caught) {
                start = number.indexOf("47", start + 1);
            }
        }

        if (caught) {
            int type = k % 2;
            if (type != 0) {
                result[start + 1] = (result[start + 1] == '4') ? '7' : '4';
            }
        }
        for (char c : result) {
            output.print(c);
        }

    }

    public void run() {
        try {
            solve();
        } catch (Throwable e) {
            System.err.println(e.getMessage());
            e.printStackTrace();
            System.exit(666);
        } finally {
            output.flush();
            output.close();
        }
    }

    public static void main(String[] args) {
        new TaskB(0).start();
    }

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

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

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

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

    private static final String INPUT_FILE = null;
    private static final String OUTPUT_FILE = null;
    private BufferedReader input;
    private PrintWriter output;
    private StringTokenizer tokens = null;
}


import javax.sound.sampled.Line;
import java.awt.Point;
import java.awt.geom.Line2D;
import java.awt.geom.Point2D;
import java.io.*;
import java.math.BigDecimal;
import java.math.BigInteger;
import static java.math.BigInteger.*;

import java.math.MathContext;
import java.util.*;
public class B{

    void solve()throws Exception
    {

        int n=nextInt();
        int k=nextInt();
        char[]ch=nextLine().toCharArray();
        int[]a=new int[n];
        for(int i=0;i<n;i++)
            a[i]=ch[i]-'0';
        int at=0;
        while (k>0)
        {

            while(at<n-1)
            {
                if(a[at]==4 && a[at+1]==7)
                    break;
                at++;
            }
            if(at==n-1)
                break;
            if(at>0 && a[at-1]==4 && (at+1)%2==0)
            {
                if(k%2==1)
                {
                    a[at]=7;
                    break;
                }
                else
                {
                    a[at]=4;
                    break;
                }
            }
            else
            {
                if((at+1)%2==1)
                {
                    a[at+1]=4;
                }
                else
                {
                    a[at]=7;
                }

                at++;
            }
            k--;
        }
        for(int i=0;i<n;i++)
        {
                System.out.print(a[i]);

        }
        System.out.println();

    }

    ////////////
    BufferedReader reader;
    PrintWriter writer;
    StringTokenizer stk;
    void run()throws Exception
    {
        reader=new BufferedReader(new InputStreamReader(System.in));
        stk=null;
        writer=new PrintWriter(new PrintWriter(System.out));
        solve();
        reader.close();
        writer.close();
    }
    int nextInt()throws Exception
    {
        return Integer.parseInt(nextToken());
    }

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

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

    }

    String nextString()throws Exception
    {
        return nextToken();
    }
    String nextLine()throws Exception
    {
        return reader.readLine();
    }
    String nextToken()throws Exception
    {
        if(stk==null || !stk.hasMoreTokens())
        {
            stk=new StringTokenizer(nextLine());
            return nextToken();

        }
        return stk.nextToken();
    }

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

}


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

public class D implements Runnable {

	private void Solution() throws IOException {
		int n = nextInt(), k = nextInt();
		String s = nextToken();
		char c[] = s.toCharArray();
		for (int i = 0; i < n-1; i ++) {
			if (k == 0)
				break;
			if (c[i] == '4' && c[i+1] == '7') {
				k --;
				if (i % 2 == 0) {
					c[i+1] = '4';
				} else {
					c[i] = '7';
					if (i != 0 && c[i-1] == '4') {
						c[i] = (k % 2 == 0)?'7':'4';
						break;
					}
				}
			}
		}
		System.out.println(new String(c));
	}

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

	BufferedReader in;
	StringTokenizer tokenizer;

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

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

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


import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.LinkedList;
import java.util.Locale;
import java.util.Queue;
import java.util.StringTokenizer;
import java.util.TreeMap;
import java.util.TreeSet;
import java.util.Map.Entry;

public class Solution implements Runnable {

	public static void main(String[] args) {
		(new Thread(new Solution())).start();
	}

	BufferedReader in;
	PrintWriter out;
	StringTokenizer st;

	String nextToken() throws IOException {
		while (st == null || !st.hasMoreTokens()) {
			String r = in.readLine();
			if (r == null) return null;
			st = new StringTokenizer(r);
		}
		return st.nextToken();
	}

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

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

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

	void solve() throws Exception {
		int n = nextInt();
		int k = nextInt();
		char[] d = nextToken().toCharArray();
		for (int i = 0; i < n - 1; i++) {
			if (d[i] == '4' && d[i + 1] == '7') {
				if (i % 2 == 1) {
					if (i > 0 && d[i - 1] == '4') {
						k %= 2;
						if (k > 0) {
							d[i] = '7';
							k--;
						}
					} else {
						d[i] = '7';
						k--;
					}
				} else {
					if (i < n - 2 && d[i + 2] != '7') {
						d[i + 1] = '4';
						k--;
					} else {
						k %= 2;
						if (k > 0) {
							d[i + 1] = '4';
							k--;
						}
					}
				}
			}
			if (k == 0) break;
		}
		out.println(d);
	}

	public void run() {
		Locale.setDefault(Locale.UK);
		try {
			in = new BufferedReader(new InputStreamReader(System.in));
			out = new PrintWriter(System.out);
//			in = new BufferedReader(new FileReader("input.txt"));
//			out = new PrintWriter("output.txt");
			solve();
		} catch (Exception e) {
			e.printStackTrace();
			System.exit(1);
		} finally {
			out.flush();
		}
	}

}


import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.LinkedList;
import java.util.Locale;
import java.util.Queue;
import java.util.StringTokenizer;
import java.util.TreeMap;
import java.util.TreeSet;
import java.util.Map.Entry;

public class Solution implements Runnable {

	public static void main(String[] args) {
		(new Thread(new Solution())).start();
	}

	BufferedReader in;
	PrintWriter out;
	StringTokenizer st;

	String nextToken() throws IOException {
		while (st == null || !st.hasMoreTokens()) {
			String r = in.readLine();
			if (r == null) return null;
			st = new StringTokenizer(r);
		}
		return st.nextToken();
	}

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

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

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

	void solve() throws Exception {
		int n = nextInt();
		int k = nextInt();
		char[] d = nextToken().toCharArray();
		for (int i = 0; i < n - 1; i++) {
			if (k == 0) break;
			if (d[i] == '4' && d[i + 1] == '7') {
				if (i % 2 == 1) {
					if (i > 0 && d[i - 1] == '4') {
						k %= 2;
						if (k > 0) {
							d[i] = '7';
							k--;
						}
					} else {
						d[i] = '7';
						k--;
					}
				} else {
					if (i < n - 2 && d[i + 2] == '7') {
						k %= 2;
						if (k > 0) {
							d[i + 1] = '4';
							k--;
						}
					} else {
						d[i + 1] = '4';
						k--;
					}
				}
			}
		}
		out.println(d);
	}

	public void run() {
		Locale.setDefault(Locale.UK);
		try {
			in = new BufferedReader(new InputStreamReader(System.in));
			out = new PrintWriter(System.out);
//			in = new BufferedReader(new FileReader("input.txt"));
//			out = new PrintWriter("output.txt");
			solve();
		} catch (Exception e) {
			e.printStackTrace();
			System.exit(1);
		} finally {
			out.flush();
		}
	}

}


import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner r = new Scanner(System.in);

        int N = r.nextInt();
        int K = r.nextInt();

        char[] a = r.next().toCharArray();
        if(K == 0){
            System.out.println(new String(a));
            return;
        }

        for(int i = 0; i < N - 1; i++){
            if(a[i] == '4' && a[i + 1] == '7'){
                if(i % 2 != 0){
                    a[i] = '7';
                    if(i - 1 >= 0 && a[i - 1] == '4'){
                        if(K % 2 == 0){
                            a[i] = '4';
                            break;
                        }else{
                            break;
                        }
                    }else{
                        K--;
                        if(K == 0)break;
                    }
                }else{
                    a[i + 1] = '4';
                    K--;
                    if(K == 0)break;
                }
            }
        }

        System.out.println(new String(a));
    }
}


import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner r = new Scanner(System.in);

        int N = r.nextInt();
        int K = r.nextInt();

        char[] a = r.next().toCharArray();

        for(int i = 0; i < N - 1; i++){
            if(a[i] == '4' && a[i + 1] == '7'){
                if(i % 2 != 0){
                    a[i] = '7';
                    if(i - 1 >= 0 && a[i - 1] == '4'){
                        if(K % 2 == 0){
                            a[i] = '4';
                            break;
                        }else{
                            break;
                        }
                    }else{
                        K--;
                        if(K == 0)break;
                    }
                }else{
                    a[i + 1] = '4';
                    K--;
                    if(K == 0)break;
                }
            }
        }

        System.out.println(new String(a));
    }
}


import static java.lang.Math.*;
import static java.lang.System.currentTimeMillis;
import static java.lang.System.exit;
import static java.lang.System.arraycopy;
import static java.util.Arrays.sort;
import static java.util.Arrays.binarySearch;
import static java.util.Arrays.fill;
import java.util.*;
import java.io.*;
import java.math.BigInteger;

public class Main {

	public static void main(String[] args) throws IOException {
		try {
			if (new File("input.txt").exists())
				System.setIn(new FileInputStream("input.txt"));
		} catch (SecurityException e) {
		}
		new Thread(null, new Runnable() {
			public void run() {
				try {
					new Main().run();
				} catch (Throwable e) {
					e.printStackTrace();
					exit(999);
				}
			}
		}, "1", 1 << 23).start();
	}

	BufferedReader in;
	PrintWriter out;
	StringTokenizer st = new StringTokenizer("");

	HashMap<Long, Long> hm = new HashMap<Long, Long>();

	int lim;
	int n;
	int maxL = 1000 * 100;
	long mp = BigInteger.probablePrime(31, new Random(721341)).longValue();
	long pow[] = new long[maxL];
	char s[];

	long hash, doing;
	void check(){
		System.err.println(new String(s));
		System.err.println("hash = " + hash);
		if(hm.containsKey(hash)){
			if(doing - hm.get(hash) == 0)
				return;
			doing += ((lim - doing) / (doing - hm.get(hash))) * (doing - hm.get(hash));
		}
		else
			hm.put(hash, doing);
	}
	private void run() throws IOException {
		in = new BufferedReader(new InputStreamReader(System.in));
		out = new PrintWriter(System.out);

		nextInt();
		lim = nextInt();
		s = nextToken().toCharArray();
		n = s.length;
		doing = 0;
		hash = 0L;

		long cp = 1;
		for(int i = 0; i < s.length; i++){
			hash += s[i] * cp;
			pow[i] = cp;
			cp = mp * cp;
		}

		for(int t = 0; t < 4 && lim > doing; t++){
			for(int i = 0; i < n - 1 && lim > doing; i++){

				if(s[i] == '4' && s[i + 1] == '7'){
					if((i & 1) == 1){
						hash -= s[i] * pow[i];
						hash -= s[i + 1] * pow[i + 1];
						hash += '7' * (pow[i] + pow[i + 1]);
						s[i] = s[i+1] = '7';
						i = max(-1, i - 2);
						doing++;
						check();
					} else {
						hash -= s[i] * pow[i];
						hash -= s[i + 1] * pow[i + 1];
						hash += '4' * (pow[i] + pow[i + 1]);
						s[i] = s[i+1] = '4';
						i = max(-1, i - 2);
						doing++;
						check();
					}
				}
			}

		}
		out.println(new String(s));

		in.close();
		out.close();
	}
	String nextToken() throws IOException {
		while (!st.hasMoreTokens())
			st = new StringTokenizer(in.readLine());
		return st.nextToken();
	}
	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 nextLine() throws IOException {
		st = new StringTokenizer("");
		return in.readLine();
	}
	boolean EOF() throws IOException {
		while (!st.hasMoreTokens()) {
			String s = in.readLine();
			if (s == null)
				return true;
			st = new StringTokenizer(s);
		}
		return false;
	}
}


import static java.lang.Math.*;
import static java.lang.System.currentTimeMillis;
import static java.lang.System.exit;
import static java.lang.System.arraycopy;
import static java.util.Arrays.sort;
import static java.util.Arrays.binarySearch;
import static java.util.Arrays.fill;
import java.util.*;
import java.io.*;
import java.math.BigInteger;

public class Main {

	public static void main(String[] args) throws IOException {
		try {
			if (new File("input.txt").exists())
				System.setIn(new FileInputStream("input.txt"));
		} catch (SecurityException e) {
		}
		new Thread(null, new Runnable() {
			public void run() {
				try {
					new Main().run();
				} catch (Throwable e) {
					e.printStackTrace();
					exit(999);
				}
			}
		}, "1", 1 << 23).start();
	}

	BufferedReader in;
	PrintWriter out;
	StringTokenizer st = new StringTokenizer("");

	HashMap<Long, Long> hm = new HashMap<Long, Long>();

	int lim;
	int n;
	int maxL = 1000 * 100;
	long mp = BigInteger.probablePrime(31, new Random(721341)).longValue();
	long pow[] = new long[maxL];

	long hash, doing;
	void check(){
		if(hm.containsKey(hash)){
			if(doing - hm.get(hash) == 0)
				return;
			doing += ((lim - doing) / (doing - hm.get(hash))) * (doing - hm.get(hash));
		}
		else
			hm.put(hash, doing);
	}
	private void run() throws IOException {
		in = new BufferedReader(new InputStreamReader(System.in));
		out = new PrintWriter(System.out);

		n = nextInt();
		lim = nextInt();
		char s[] = nextToken().toCharArray();
		doing = 0;
		hash = 0L;

		long cp = 1;
		for(int i = 0; i < s.length; i++){
			hash += s[i] * cp;
			pow[i] = cp;
			cp = mp * cp;
		}

		for(int t = 0; t < 4 && lim > doing; t++){
			for(int i = 0; i < n - 1 && lim > doing; i++){

				if(s[i] == '4' && s[i + 1] == '7'){
					if((i & 1) == 1){
						hash -= s[i] * pow[i];
						hash -= s[i + 1] * pow[i + 1];
						hash += '7' * (pow[i] + pow[i + 1]);
						if(hash < 0)
							hash += Long.MAX_VALUE;
						s[i] = s[i+1] = '7';
						i = max(-1, i - 2);
						doing++;
						check();
					} else {
						hash -= s[i] * pow[i];
						hash -= s[i + 1] * pow[i + 1];
						hash += '4' * (pow[i] + pow[i + 1]);
						if(hash < 0)
							hash += Long.MAX_VALUE;
						s[i] = s[i+1] = '4';
						i = max(-1, i - 2);
						doing++;
						check();
					}
				}
			}

		}
		out.println(new String(s));

		in.close();
		out.close();
	}
	String nextToken() throws IOException {
		while (!st.hasMoreTokens())
			st = new StringTokenizer(in.readLine());
		return st.nextToken();
	}
	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 nextLine() throws IOException {
		st = new StringTokenizer("");
		return in.readLine();
	}
	boolean EOF() throws IOException {
		while (!st.hasMoreTokens()) {
			String s = in.readLine();
			if (s == null)
				return true;
			st = new StringTokenizer(s);
		}
		return false;
	}
}


import static java.lang.Math.*;
import static java.lang.System.currentTimeMillis;
import static java.lang.System.exit;
import static java.lang.System.arraycopy;
import static java.util.Arrays.sort;
import static java.util.Arrays.binarySearch;
import static java.util.Arrays.fill;
import java.util.*;
import java.io.*;
import java.math.BigInteger;

public class Main {

	public static void main(String[] args) throws IOException {
		try {
			if (new File("input.txt").exists())
				System.setIn(new FileInputStream("input.txt"));
		} catch (SecurityException e) {
		}
		new Thread(null, new Runnable() {
			public void run() {
				try {
					new Main().run();
				} catch (Throwable e) {
					e.printStackTrace();
					exit(999);
				}
			}
		}, "1", 1 << 23).start();
	}

	BufferedReader in;
	PrintWriter out;
	StringTokenizer st = new StringTokenizer("");

	HashMap<Long, Long> hm = new HashMap<Long, Long>();

	int lim;
	int n;
	int maxL = 1000 * 100;
	long mp = BigInteger.probablePrime(31, new Random(721341)).longValue();
	long pow[] = new long[maxL];
	char s[];

	long hash, doing;
	void check(){
		if(hm.containsKey(hash)){
			if(doing - hm.get(hash) == 0)
				return;
			doing += ((lim - doing) / (doing - hm.get(hash))) * (doing - hm.get(hash));
		}
		else
			hm.put(hash, doing);
	}
	private void run() throws IOException {
		in = new BufferedReader(new InputStreamReader(System.in));
		out = new PrintWriter(System.out);

		nextInt();
		lim = nextInt();
		s = nextToken().toCharArray();
		n = s.length;
		doing = 0;
		hash = 0L;

		long cp = 1;
		for(int i = 0; i < s.length; i++){
			hash += s[i] * cp;
			pow[i] = cp;
			cp = mp * cp;
		}

		for(int t = 0; t < 4 && lim > doing; t++){
			for(int i = 0; i < n - 1 && lim > doing; i++){

				if(s[i] == '4' && s[i + 1] == '7'){
					if((i & 1) == 1){
						hash -= s[i] * pow[i];
						hash -= s[i + 1] * pow[i + 1];
						hash += '7' * (pow[i] + pow[i + 1]);
						s[i] = s[i+1] = '7';
						i = max(-1, i - 2);
						doing++;
						check();
					} else {
						hash -= s[i] * pow[i];
						hash -= s[i + 1] * pow[i + 1];
						hash += '4' * (pow[i] + pow[i + 1]);
						s[i] = s[i+1] = '4';
						i = max(-1, i - 2);
						doing++;
						check();
					}
				}
			}

		}
		out.println(new String(s));

		in.close();
		out.close();
	}
	String nextToken() throws IOException {
		while (!st.hasMoreTokens())
			st = new StringTokenizer(in.readLine());
		return st.nextToken();
	}
	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 nextLine() throws IOException {
		st = new StringTokenizer("");
		return in.readLine();
	}
	boolean EOF() throws IOException {
		while (!st.hasMoreTokens()) {
			String s = in.readLine();
			if (s == null)
				return true;
			st = new StringTokenizer(s);
		}
		return false;
	}
}


import static java.lang.Math.*;
import static java.lang.System.currentTimeMillis;
import static java.lang.System.exit;
import static java.lang.System.arraycopy;
import static java.util.Arrays.sort;
import static java.util.Arrays.binarySearch;
import static java.util.Arrays.fill;
import java.util.*;
import java.io.*;
import java.math.BigInteger;

public class Main {

	public static void main(String[] args) throws IOException {
		try {
			if (new File("input.txt").exists())
				System.setIn(new FileInputStream("input.txt"));
		} catch (SecurityException e) {
		}
		new Thread(null, new Runnable() {
			public void run() {
				try {
					new Main().run();
				} catch (Throwable e) {
					e.printStackTrace();
					exit(999);
				}
			}
		}, "1", 1 << 23).start();
	}

	BufferedReader in;
	PrintWriter out;
	StringTokenizer st = new StringTokenizer("");

	HashMap<Long, Long> hm = new HashMap<Long, Long>();

	int lim;
	int n;
	int maxL = 1000 * 100;
	long mp = BigInteger.probablePrime(31, new Random(721341)).longValue();
	long pow[] = new long[maxL];

	long hash, doing;
	void check(){
		if(hm.containsKey(hash)){
//			System.err.println(s);
			System.err.println(doing);
			if(doing - hm.get(hash) == 0)
				return;
			doing += ((lim - doing) / (doing - hm.get(hash))) * (doing - hm.get(hash));
			System.err.println(doing);
		}
		else
			hm.put(hash, doing);
	}
	private void run() throws IOException {
		in = new BufferedReader(new InputStreamReader(System.in));
		out = new PrintWriter(System.out);

		n = nextInt();
		lim = nextInt();
		char s[] = nextToken().toCharArray();
		doing = 0;
		hash = 0L;

		long cp = 1;
		for(int i = 0; i < s.length; i++){
			hash += s[i] * cp;
			pow[i] = cp;
			cp = mp * cp;
		}

		ex: for(int t = 0; t < 4 && lim > doing; t++){
			for(int i = 0; i < n - 1 && lim > doing; i++){

				if(s[i] == '4' && s[i + 1] == '7'){
					if((i & 1) == 1){
						hash -= s[i] * pow[i];
						hash -= s[i + 1] * pow[i + 1];
						hash += '7' * (pow[i] + pow[i + 1]);
						s[i] = s[i+1] = '7';
						i = max(-1, i - 2);
						doing++;
					} else {
						hash -= s[i] * pow[i];
						hash -= s[i + 1] * pow[i + 1];
						hash += '4' * (pow[i] + pow[i + 1]);
						s[i] = s[i+1] = '4';
						i = max(-1, i - 2);
						doing++;
					}
				}
			}

		}
		out.println(new String(s));

		in.close();
		out.close();
	}
	String nextToken() throws IOException {
		while (!st.hasMoreTokens())
			st = new StringTokenizer(in.readLine());
		return st.nextToken();
	}
	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 nextLine() throws IOException {
		st = new StringTokenizer("");
		return in.readLine();
	}
	boolean EOF() throws IOException {
		while (!st.hasMoreTokens()) {
			String s = in.readLine();
			if (s == null)
				return true;
			st = new StringTokenizer(s);
		}
		return false;
	}
}


import static java.lang.Math.*;
import static java.lang.System.currentTimeMillis;
import static java.lang.System.exit;
import static java.lang.System.arraycopy;
import static java.util.Arrays.sort;
import static java.util.Arrays.binarySearch;
import static java.util.Arrays.fill;
import java.util.*;
import java.io.*;

public class Main {

	public static void main(String[] args) throws IOException {
		try {
			if (new File("input.txt").exists())
				System.setIn(new FileInputStream("input.txt"));
		} catch (SecurityException e) {
		}
		new Thread(null, new Runnable() {
			public void run() {
				try {
					new Main().run();
				} catch (Throwable e) {
					e.printStackTrace();
					exit(999);
				}
			}
		}, "1", 1 << 23).start();
	}

	BufferedReader in;
	PrintWriter out;
	StringTokenizer st = new StringTokenizer("");

	HashMap<String, Integer> hm = new HashMap<String, Integer>();

	int lim;
	int n;

	private void run() throws IOException {
		in = new BufferedReader(new InputStreamReader(System.in));
		out = new PrintWriter(System.out);

		n = nextInt();
		lim = nextInt();
		char s[] = nextToken().toCharArray();
		int doing = 0;
		ex: for(int t = 0; t < 4 && lim > doing; t++){
			for(int i = 0; i < n - 1 && lim > doing; i++){
				if(s[i] == '4' && s[i + 1] == '7'){
					if((i & 1) == 1){
						s[i] = s[i+1] = '7';
						i--;
						doing++;
					} else {
						s[i] = s[i+1] = '4';
						i--;
						doing++;
					}
				}
			}
			String ss = new String(s);
			if(hm.containsKey(ss)){
				if(doing - hm.get(ss) == 0)
					break ex;
				doing += (lim - doing) % (doing - hm.get(ss));
			}
			else
				hm.put(ss, doing);
		}
		out.println(new String(s));

		in.close();
		out.close();
	}
	String nextToken() throws IOException {
		while (!st.hasMoreTokens())
			st = new StringTokenizer(in.readLine());
		return st.nextToken();
	}
	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 nextLine() throws IOException {
		st = new StringTokenizer("");
		return in.readLine();
	}
	boolean EOF() throws IOException {
		while (!st.hasMoreTokens()) {
			String s = in.readLine();
			if (s == null)
				return true;
			st = new StringTokenizer(s);
		}
		return false;
	}
}


import static java.lang.Math.*;
import static java.lang.System.currentTimeMillis;
import static java.lang.System.exit;
import static java.lang.System.arraycopy;
import static java.util.Arrays.sort;
import static java.util.Arrays.binarySearch;
import static java.util.Arrays.fill;
import java.util.*;
import java.io.*;
import java.math.BigInteger;

public class Main {

	public static void main(String[] args) throws IOException {
		try {
			if (new File("input.txt").exists())
				System.setIn(new FileInputStream("input.txt"));
		} catch (SecurityException e) {
		}
		new Thread(null, new Runnable() {
			public void run() {
				try {
					new Main().run();
				} catch (Throwable e) {
					e.printStackTrace();
					exit(999);
				}
			}
		}, "1", 1 << 23).start();
	}

	BufferedReader in;
	PrintWriter out;
	StringTokenizer st = new StringTokenizer("");

	HashMap<Long, Long> hm = new HashMap<Long, Long>();

	int lim;
	int n;
	int maxL = 1000 * 100;
	long mp = BigInteger.probablePrime(31, new Random(721341)).longValue();
	long pow[] = new long[maxL];

	long hash, doing;
	void check(){
		if(hm.containsKey(hash)){
//			System.err.println(s);
			System.err.println(doing);
			if(doing - hm.get(hash) == 0)
				return;
			doing += (lim - doing) % (doing - hm.get(hash));
			System.err.println(doing);
		}
		else
			hm.put(hash, doing);
	}
	private void run() throws IOException {
		in = new BufferedReader(new InputStreamReader(System.in));
		out = new PrintWriter(System.out);

		n = nextInt();
		lim = nextInt();
		char s[] = nextToken().toCharArray();
		doing = 0;
		hash = 0L;

		long cp = 1;
		for(int i = 0; i < s.length; i++){
			hash += s[i] * cp;
			pow[i] = cp;
			cp = mp * cp;
		}

		ex: for(int t = 0; t < 4 && lim > doing; t++){
			for(int i = 0; i < n - 1 && lim > doing; i++){

				if(s[i] == '4' && s[i + 1] == '7'){
					if((i & 1) == 1){
						hash -= s[i] * pow[i];
						hash -= s[i + 1] * pow[i + 1];
						hash += '7' * (pow[i] + pow[i + 1]);
						s[i] = s[i+1] = '7';
						i = max(-1, i - 2);
						doing++;
					} else {
						hash -= s[i] * pow[i];
						hash -= s[i + 1] * pow[i + 1];
						hash += '4' * (pow[i] + pow[i + 1]);
						s[i] = s[i+1] = '4';
						i = max(-1, i - 2);
						doing++;
					}
				}
			}

		}
		out.println(new String(s));

		in.close();
		out.close();
	}
	String nextToken() throws IOException {
		while (!st.hasMoreTokens())
			st = new StringTokenizer(in.readLine());
		return st.nextToken();
	}
	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 nextLine() throws IOException {
		st = new StringTokenizer("");
		return in.readLine();
	}
	boolean EOF() throws IOException {
		while (!st.hasMoreTokens()) {
			String s = in.readLine();
			if (s == null)
				return true;
			st = new StringTokenizer(s);
		}
		return false;
	}
}


import static java.lang.Math.*;
import static java.lang.System.currentTimeMillis;
import static java.lang.System.exit;
import static java.lang.System.arraycopy;
import static java.util.Arrays.sort;
import static java.util.Arrays.binarySearch;
import static java.util.Arrays.fill;
import java.util.*;
import java.io.*;

public class Main {

	public static void main(String[] args) throws IOException {
		try {
			if (new File("input.txt").exists())
				System.setIn(new FileInputStream("input.txt"));
		} catch (SecurityException e) {
		}
		new Thread(null, new Runnable() {
			public void run() {
				try {
					new Main().run();
				} catch (Throwable e) {
					e.printStackTrace();
					exit(999);
				}
			}
		}, "1", 1 << 23).start();
	}

	BufferedReader in;
	PrintWriter out;
	StringTokenizer st = new StringTokenizer("");

	HashMap<String, Integer> hm = new HashMap<String, Integer>();

	int lim;
	int n;

	private void run() throws IOException {
		in = new BufferedReader(new InputStreamReader(System.in));
		out = new PrintWriter(System.out);

		n = nextInt();
		lim = nextInt();
		char s[] = nextToken().toCharArray();
		int doing = 0;
		ex: for(int t = 0; t < 4 && lim > doing; t++){
			for(int i = 0; i < n - 1 && lim > doing; i++){
				if(s[i] == '4' && s[i + 1] == '7'){
					if((i & 1) == 1){
						s[i] = s[i+1] = '7';
						i = max(-1, i - 2);
						doing++;
					} else {
						s[i] = s[i+1] = '4';
						i = max(-1, i - 2);
						doing++;
					}
				}
			}
			String ss = new String(s);
			if(hm.containsKey(ss)){
				if(doing - hm.get(ss) == 0)
					break ex;
				doing += (lim - doing) % (doing - hm.get(ss));
			}
			else
				hm.put(ss, doing);
		}
		out.println(new String(s));

		in.close();
		out.close();
	}
	String nextToken() throws IOException {
		while (!st.hasMoreTokens())
			st = new StringTokenizer(in.readLine());
		return st.nextToken();
	}
	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 nextLine() throws IOException {
		st = new StringTokenizer("");
		return in.readLine();
	}
	boolean EOF() throws IOException {
		while (!st.hasMoreTokens()) {
			String s = in.readLine();
			if (s == null)
				return true;
			st = new StringTokenizer(s);
		}
		return false;
	}
}


import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

public class problem{

    public static void main(String[] args) {
    	Scanner scan=new Scanner(System.in);
    	int n=scan.nextInt(),k=scan.nextInt();
    	scan.nextLine();
    	char[] s=scan.nextLine().toCharArray();
    	int i=0,j=0;
    	while(i<n-1 && j<k)
    	{
    		if(s[i]=='4' && s[i+1]=='7')
    		{
    			if(i%2==0)s[i+1]='4';
    			else {
    				s[i]='7';
    				while(s[i]=='7' && i>0)
    				{
    					i--;
    				}
    			}
    			j++;
    		}else
    			i++;

    	}
        System.out.println(s);

    }

}


import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

public class problem{

    public static void main(String[] args) {
    	Scanner scan=new Scanner(System.in);
    	int n=scan.nextInt(),k=scan.nextInt();
    	scan.nextLine();
    	char[] s=scan.nextLine().toCharArray();
    	int i=0,j=0;
    	while(i<n && j<k)
    	{
    		if(s[i]=='4' && s[i+1]=='7')
    		{
    			if(i%2==0)s[i+1]='4';
    			else {
    				s[i]='7';
    				while(s[i]=='7' && i>0)
    				{
    					i--;
    				}
    			}
    			j++;
    		}else
    			i++;

    	}
        System.out.println(s);

    }

}


import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

public class problem{

    public static void main(String[] args) {
    	Scanner scan=new Scanner(System.in);
    	int n=scan.nextInt(),k=scan.nextInt();
    	scan.nextLine();
    	char[] s=scan.nextLine().toCharArray();
    	int i=0,j=0;
    	while(i<n-1 && j<k)
    	{
    		if(s[i]=='4' && s[i+1]=='7')
    		{
    			if(i%2==0)
    			{
    				if(i+2<n && k-j>1 && s[i+2]=='7')
    				{
    					j+=(k-j)-(k-j)%2;
    					continue;
    				}
    				s[i+1]='4';
    			}
    			else {
    				if(i-1>=0 && k-j>1 && s[i-1]=='4')
    				{
    					j+=(k-j)-(k-j)%2;
    					i--;
    					continue;
    				}
    				s[i]='7';
    				while(s[i]=='7' && i>0)
    				{
    					i--;
    				}
    			}
    			j++;
    		}else
    			i++;

    	}
        System.out.println(s);

    }

}


import static java.util.Arrays.*;
import static java.lang.Math.*;
import static java.math.BigInteger.*;
import java.util.*;
import java.math.*;
import java.io.*;

public class B implements Runnable
{
    String file = "input";

    boolean TEST = false;

    void solve() throws IOException
    {
        int n = nextInt(), k = nextInt();
        char[] cs = next().toCharArray();
        cs = get(cs);
        n++;
        int i = 1;
        outer: while(k > 0)
        {
            inner: for(; i < n; i++)
            {
                if(i + 2 < n && i % 2 == 1)
                {
                    if(cs[i] == '4' && cs[i + 1] == '4' && cs[i + 2] == '7')
                    {
                        if(k % 2 != 0)
                        {
                            cs[i] = '4';
                            cs[i + 1] = '7';
                            cs[i + 2] = '7';
                        }
                        break outer;
                    }
                    if(cs[i] == '4' && cs[i + 1] == '7' && cs[i + 2] == '7')
                    {
                        if(k % 2 != 0)
                        {
                            cs[i] = '4';
                            cs[i + 1] = '4';
                            cs[i + 2] = '7';
                        }
                        break outer;
                    }
                }
                if(i + 1 < n && cs[i] == '4' && cs[i + 1] == '7')
                {
                    k--;
                    if(i % 2 == 0)
                    {
                        cs[i] = '7';
                    }
                    else
                    {
                        cs[i + 1] = '4';
                    }
                    break inner;
                }
            }
            if(i == n) break;
        }
        char[] res = new char[n - 1];
        for(int j = 1; j < cs.length; j++) res[j - 1] = cs[j];
        out.println(res);
    }
    char[] get(char[] cs)
    {
        char[] res = new char[cs.length + 1];
        for(int i = 0; i < cs.length; i++) res[i + 1] = cs[i];
        return res;
    }
    String next() throws IOException
    {
        while(st == null || !st.hasMoreTokens()) st = new StringTokenizer(input.readLine());
        return st.nextToken();
    }

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

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

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

    void print(Object... o)
    {
        System.out.println(deepToString(o));
    }

    void gcj(Object o)
    {
        String s = String.valueOf(o);
        out.println("Case #" + test + ": " + s);
        System.out.println("Case #" + test + ": " + s);
    }

    BufferedReader input;
    PrintWriter out;
    StringTokenizer st;
    int test;

    void init() throws IOException
    {
        if(TEST) input = new BufferedReader(new FileReader(file + ".in"));
        else input = new BufferedReader(new InputStreamReader(System.in));
        out = new PrintWriter(new BufferedOutputStream(System.out));
    }

    public static void main(String[] args) throws IOException
    {
        new Thread(null, new B(), "", 1 << 20).start();
    }

    public void run()
    {
        try
        {
            init();
            if(TEST)
            {
                int runs = nextInt();
                for(int i = 0; i < runs; i++) solve();
            }
            else solve();
            out.close();
        }
        catch(Exception e)
        {
            e.printStackTrace();
            System.exit(1);
        }
    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.InputMismatchException;
import java.math.BigInteger;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 * @author Egor Kulikov (egor@egork.net)
 */
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);
		TaskB solver = new TaskB();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskB {
	public void solve(int testNumber, InputReader in, PrintWriter out) {
		int count = in.readInt();
		int operationCount = in.readInt();
		char[] digits = in.readString().toCharArray();
		for (int i = 1; i < count && operationCount > 0; i++) {
			if (digits[i - 1] == '4' && digits[i] == '7') {
				if (i % 2 == 0) {
					digits[i - 1] = '7';
					operationCount--;
					if (digits[i - 2] == '4') {
						if (operationCount % 2 == 1)
							digits[i - 1] = '4';
						operationCount = 0;
					}
				} else {
					digits[i] = '4';
					operationCount--;
					if (i + 1 < count && digits[i + 1] == '7') {
						if (operationCount % 2 == 1)
							digits[i] = '7';
						operationCount = 0;
					}
				}
			}
		}
		out.println(digits);
	}
}

class InputReader {

	private InputStream stream;
	private byte[] buf = new byte[1024];
	private int curChar;
	private int numChars;

	public InputReader(InputStream stream) {
		this.stream = stream;
	}

	public int read() {
		if (numChars == -1)
			throw new InputMismatchException();
		if (curChar >= numChars) {
			curChar = 0;
			try {
				numChars = stream.read(buf);
			} catch (IOException e) {
				throw new InputMismatchException();
			}
			if (numChars <= 0)
				return -1;
		}
		return buf[curChar++];
	}

	public int readInt() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		int sgn = 1;
		if (c == '-') {
			sgn = -1;
			c = read();
		}
		int res = 0;
		do {
			if (c < '0' || c > '9')
				throw new InputMismatchException();
			res *= 10;
			res += c - '0';
			c = read();
		} while (!isSpaceChar(c));
		return res * sgn;
	}

	public String readString() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		StringBuffer res = new StringBuffer();
		do {
			res.appendCodePoint(c);
			c = read();
		} while (!isSpaceChar(c));
		return res.toString();
	}

	private boolean isSpaceChar(int c) {
		return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
	}

	}


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

//created at 7:18 PM 10/27/11 by Abrackadabra

public class B {
    int IOMode = 0; //0 - consoleIO, 1 - <taskName>.in/out, 2 - input.txt/output.txt, 3 - test case generator
    String taskName = "";

    int n, k;

    void solve() throws IOException {
        n = nextInt();
        k = nextInt();
        String s = nextString();
        int[] a = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = s.charAt(i) - '0';
        }
        for (int i = 0; i < n - 1; i++) {
            if (i == -1) continue;
            if (k == 0) break;
            if (a[i] == 4 && a[i + 1] == 7) {
                k--;
                if (i > 0 && a[i - 1] == 4 && i % 2 == 1) {
                    k = k % 2;
                }
                if (i % 2 == 0) {
                    a[i] = 4;
                    a[i + 1] = 4;
                } else {
                    a[i] = 7;
                    a[i + 1] = 7;
                    i -= 2;
                }
            }
        }
        for (int i = 0; i < n; i++)
            out.print(a[i]);
    }

    public static void main(String[] args) throws IOException {
        if (args.length > 0 && args[0].equals("Abra")) debugMode = true;
        new B().run();
    }

    long startTime = System.nanoTime(), tempTime = startTime, finishTime = startTime;
    long startMem = Runtime.getRuntime().totalMemory(), finishMem = startMem;

    void run() throws IOException {
        init();
        if (debugMode) {
            con.println("Start");
            con.println("Console output:");
        }
        solve();
        finishTime = System.nanoTime();
        finishMem = Runtime.getRuntime().totalMemory();
        out.flush();
        if (debugMode) {
            int maxSymbols = 1000, c = 0;
            BufferedReader tbr = new BufferedReader(new FileReader("input.txt"));
            char[] a = new char[maxSymbols];
            tbr.read(a);
            if (a[0] != 0) {
                con.println();
                con.println("File input:");
                con.print(a);
            }
            boolean left = true;
            for (int i = 0; i < maxSymbols; i++) left = left && a[i] != 0;
            if (left) con.println("...");
            else con.println();
            tbr = new BufferedReader(new FileReader("output.txt"));
            a = new char[maxSymbols];
            tbr.read(a);
            if (a[0] != 0) {
                con.println();
                con.println("File output:");
                con.print(a);
            }
            left = true;
            for (int i = 0; i < maxSymbols; i++) left = left && a[i] != 0;
            if (left) con.println("...");
            else con.println();
            con.println("Time passed:  " + (finishTime - startTime) / 1000000000.0 + " sec");
            con.println("Memory used:  " + (finishMem - startMem) + " bytes");
            con.println("Total memory: " + Runtime.getRuntime().totalMemory() + " bytes");
        }
    }

    boolean tick(double x) {
        if (System.nanoTime() - tempTime > x) {
            tempTime = System.nanoTime();
            con.println("Tick at " + (tempTime - startTime) / 1000000000 + " sec");
            con.print("   ");
            return true;
        }
        return false;
    }

    void printTime() {
        con.println((System.nanoTime() - tempTime) + " nanos passed");
        tempTime = System.nanoTime();
    }

    static boolean debugMode = false;
    PrintStream con = System.out;

    void init() throws IOException {
        if (debugMode) {
            br = new BufferedReader(new FileReader("input.txt"));
            out = new PrintWriter(new FileWriter("output.txt"));
        } else
            switch (IOMode) {
                case 0:
                    br = new BufferedReader(new InputStreamReader(System.in));
                    out = new PrintWriter(System.out);
                    break;
                case 1:
                    br = new BufferedReader(new FileReader(taskName + ".in"));
                    out = new PrintWriter(new FileWriter(taskName + ".out"));
                    break;
                case 2:
                    br = new BufferedReader(new FileReader("input.txt"));
                    out = new PrintWriter(new FileWriter("output.txt"));
                    break;
                case 3:
                    out = new PrintWriter(new FileWriter("input.txt"));
                    break;
            }
    }

    BufferedReader br;
    PrintWriter out;
    StringTokenizer in;

    boolean hasMoreTokens() throws IOException {
        while (in == null || !in.hasMoreTokens()) {
            String line = br.readLine();
            if (line == null) return false;
            in = new StringTokenizer(line);
        }
        return true;
    }

    String nextString() throws IOException {
        return hasMoreTokens() ? in.nextToken() : null;
    }

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

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

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


import static java.lang.Math.min;

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

public class Solution implements Runnable
{

        void solve() throws IOException
        {
          int n=readInt();
          int k=readInt();
          char [] s=new char[100100];
          String str=readString();
          for(int i=0;i<n;i++)
              s[i]=str.charAt(i);
          for(int i=0,j=0;i<n&&k>0;j++)
          {
            if(s[i]=='4'&&s[i+1]=='7')
            {  ////447->477->447
                if(i%2==1)
                {
                    s[i]='7';i--;
                    if(i<0) i=0;
                }
                else
                {
                    s[i+1]='4';
                    i++;
                }
                k--;
            }
            else i++;
            //if(j==10*n) k%=2;
         }
          for(int i=0;i<n;i++)
          out.print(s[i]);

        }

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

        BufferedReader reader;
        PrintWriter out;
        StringTokenizer tokenizer;

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

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

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

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

        BigInteger readBigInteger() throws IOException
        {
                return new BigInteger(readString());
        }

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


import static java.lang.Math.min;

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

public class Solution implements Runnable
{

        void solve() throws IOException
        {
          int n=readInt();
          int k=readInt();
          char [] s=new char[100100];
          String str=readString();
          for(int i=0;i<n;i++)
              s[i]=str.charAt(i);
          for(int i=0,j=0;i<n&&k>0;j++)
          {
            if(s[i]=='4'&&s[i+1]=='7')
            {  ////447->477->447
                if(i%2==1)
                {
                    s[i]='7';i--;
                    if(i<0) i=0;
                }
                else
                {
                    s[i+1]='4';
                    i++;
                }
                k--;
            }
            else i++;
            if(j==10*n) k=0;//k%=2;
         }
          for(int i=0;i<n;i++)
          out.print(s[i]);

        }

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

        BufferedReader reader;
        PrintWriter out;
        StringTokenizer tokenizer;

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

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

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

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

        BigInteger readBigInteger() throws IOException
        {
                return new BigInteger(readString());
        }

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


import static java.lang.Math.min;

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

public class Solution implements Runnable
{

        void solve() throws IOException
        {
          int n=readInt();
          int k=readInt();
          char [] s=new char[100100];
          String str=readString();
          for(int i=0;i<n;i++)
              s[i]=str.charAt(i);
          for(int i=0,j=0;i<n&&k>0;j++)
          {
              if(j==10*n) k=0;//k%=2;
            if(s[i]=='4'&&s[i+1]=='7')
            {  ////447->477->447
                if(i%2==1)
                {
                    s[i]='7';i--;
                    if(i<0) i=0;
                }
                else
                {
                    s[i+1]='4';
                    i++;
                }
                k--;
            }
            else i++;

         }
          for(int i=0;i<n;i++)
          out.print(s[i]);

        }

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

        BufferedReader reader;
        PrintWriter out;
        StringTokenizer tokenizer;

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

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

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

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

        BigInteger readBigInteger() throws IOException
        {
                return new BigInteger(readString());
        }

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


import static java.lang.Math.min;

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

public class Solution implements Runnable
{

        void solve() throws IOException
        {
          int n=readInt();
          int k=readInt();
          char [] s=new char[100100];
          String str=readString();
          for(int i=0;i<n;i++)
              s[i]=str.charAt(i);
          for(int i=0,j=0;i<n&&k>0;j++)
          {
            if(s[i]=='4'&&s[i+1]=='7')
            {  ////447
                if(i%2!=0)
                {
                    s[i]='7';i--;
                    if(i<0) i=0;
                }
                else
                {
                    s[i+1]='4';
                    i++;
                }
                k--;
            }
            else i++;
            if(j==10*n) k%=2;
         }
          for(int i=0;i<n;i++)
          out.print(s[i]);

        }

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

        BufferedReader reader;
        PrintWriter out;
        StringTokenizer tokenizer;

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

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

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

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

        BigInteger readBigInteger() throws IOException
        {
                return new BigInteger(readString());
        }

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


import java.util.*;
import java.io.*;
public class a {
    static long mod = 1000000007;
    static ArrayList<Integer>[] g;
public static void main(String[] args) throws IOException
{
    //Scanner input = new Scanner(new File("input.txt"));
    //PrintWriter out = new PrintWriter(new File("output.txt"));
  input.init(System.in);
  PrintWriter out  = new PrintWriter((System.out));
  int n = input.nextInt(), k = input.nextInt();
  int[] data = new int[n];
  String s = input.next();
  for(int i = 0; i<n; i++) data[i] = s.charAt(i) - '0';
  int at = 0, change = 0;
  for(int i = 0; change<k; i++)
  {
      if(at==n-1) break;
      if(at<n-2 && data[at] == 4 && data[at+2] == 7 && (data[at+1] == 4 || data[at+1] == 7))
      {
          if((k-change)%2 == 1)
          {
              data[at+1] = 11-data[at+1];
          }
          break;
      }
      else if(data[at] == 4 && data[at+1] == 7)
      {
          change++;
          if(at%2 == 0)
              data[at+1] = 4;
          else data[at] = 7;
          if(at>0) at--;
      }
      else at++;
  }
  for(int i: data) out.print(i);

  out.close();
}
static long pow (long a, long p)
{
    if(p==0) return 1;
    if((p&1) == 0)
    {
        long sqrt = pow(a, p/2);
        return (sqrt*sqrt)%mod;
    }
    return (a*pow(a,p-1))%mod;
}
static class input {
  static BufferedReader reader;
  static StringTokenizer tokenizer;

  /** call this method to initialize reader for InputStream */
  static void init(InputStream input) {
      reader = new BufferedReader(
                   new InputStreamReader(input) );
      tokenizer = new StringTokenizer("");
  }

  /** get next word */
  static String next() throws IOException {
      while ( ! tokenizer.hasMoreTokens() ) {
          //TODO add check for eof if necessary
          tokenizer = new StringTokenizer(
                 reader.readLine() );
      }
      return tokenizer.nextToken();
  }

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

  static double nextDouble() throws IOException {
      return Double.parseDouble( next() );
  }
  static long nextLong() throws IOException {
      return Long.parseLong( next() );
  }
  static String nextLine() throws IOException {
    return reader.readLine();
  }
}
}


import java.util.*;
import java.io.*;
public class a {
    static long mod = 1000000007;
    static ArrayList<Integer>[] g;
public static void main(String[] args) throws IOException
{
    //Scanner input = new Scanner(new File("input.txt"));
    //PrintWriter out = new PrintWriter(new File("output.txt"));
  input.init(System.in);
  PrintWriter out  = new PrintWriter((System.out));
  int n = input.nextInt(), k = input.nextInt();
  int[] data = new int[n];
  String s = input.next();
  for(int i = 0; i<n; i++) data[i] = s.charAt(i) - '0';
  int at = 0, change = 0;
  for(int i = 0; change<k; i++)
  {
      if(at==n-1) break;
      if(at<n-2 && at%2 == 0 && data[at] == 4 && data[at+2] == 7 && (data[at+1] == 4 || data[at+1] == 7))
      {
          if((k-change)%2 == 1)
          {
              data[at+1] = 11-data[at+1];
          }
          break;
      }
      else if(data[at] == 4 && data[at+1] == 7)
      {
          change++;
          if(at%2 == 0)
              data[at+1] = 4;
          else data[at] = 7;
          if(at>0) at--;
      }
      else at++;
  }
  for(int i: data) out.print(i);

  out.close();
}
static long pow (long a, long p)
{
    if(p==0) return 1;
    if((p&1) == 0)
    {
        long sqrt = pow(a, p/2);
        return (sqrt*sqrt)%mod;
    }
    return (a*pow(a,p-1))%mod;
}
static class input {
  static BufferedReader reader;
  static StringTokenizer tokenizer;

  /** call this method to initialize reader for InputStream */
  static void init(InputStream input) {
      reader = new BufferedReader(
                   new InputStreamReader(input) );
      tokenizer = new StringTokenizer("");
  }

  /** get next word */
  static String next() throws IOException {
      while ( ! tokenizer.hasMoreTokens() ) {
          //TODO add check for eof if necessary
          tokenizer = new StringTokenizer(
                 reader.readLine() );
      }
      return tokenizer.nextToken();
  }

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

  static double nextDouble() throws IOException {
      return Double.parseDouble( next() );
  }
  static long nextLong() throws IOException {
      return Long.parseLong( next() );
  }
  static String nextLine() throws IOException {
    return reader.readLine();
  }
}
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.HashSet;
import java.util.StringTokenizer;
import java.util.TreeSet;

public class Test {
	static BufferedReader reader;
	static StringTokenizer tokenizer;
	static PrintWriter writer;

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

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

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

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

	public static void main(String[] args) throws IOException {
		reader = new BufferedReader(new InputStreamReader(System.in));
		tokenizer = null;
		writer = new PrintWriter(System.out);
		solve();
		reader.close();
		writer.close();
	}

	private static void solve() throws IOException {
		int n = nextInt();
		int k = nextInt();
		int last=0;
		String s = nextToken();
		StringBuilder sb = new StringBuilder(s);

		boolean made;
		for (int j = k; j > 0; j--) {
			made = false;
			for (int i = last; i < n - 1; i++) {
				if (sb.charAt(i) == '4' && sb.charAt(i + 1) == '7') {
					last=last-1;
					if(last<0)
						last=0;
					if (i % 2 == 0) {
						sb.setCharAt(i + 1, '4');
					} else {
						if(i>0&&sb.charAt(i-1)=='4')
						{
							j=j%2;
						}
						sb.setCharAt(i, '7');
					}
					made = true;
					break;
				}
			}
			if (made == false)
				break;
		}
		writer.println(sb.toString());
	}
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.HashSet;
import java.util.StringTokenizer;
import java.util.TreeSet;

public class Test {
	static BufferedReader reader;
	static StringTokenizer tokenizer;
	static PrintWriter writer;

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

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

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

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

	public static void main(String[] args) throws IOException {
		reader = new BufferedReader(new InputStreamReader(System.in));
		tokenizer = null;
		writer = new PrintWriter(System.out);
		solve();
		reader.close();
		writer.close();
	}

	private static void solve() throws IOException {
		int n = nextInt();
		int k = nextInt();
		int last=0;
		String s = nextToken();
		char[] ch = s.toCharArray();

		boolean made;
		for (int j = k-1; j >= 0; j--) {
			made = false;
			for (int i = last; i < n - 1; i++) {
				if (ch[i] == '4' && ch[i+1] == '7') {
					last=last-1;
					if(last<0)
						last=0;
					if (i % 2 == 0) {
						ch[i+1]='4';
					} else {
						if(i>0&&ch[i-1]=='4')
						{
							j=j%2;
						}
						ch[i]='7';
					}
					made = true;
					break;
				}
			}
			if (made == false)
				break;
		}
		writer.println(ch);
	}
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.HashSet;
import java.util.StringTokenizer;
import java.util.TreeSet;

public class Test {
	static BufferedReader reader;
	static StringTokenizer tokenizer;
	static PrintWriter writer;

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

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

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

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

	public static void main(String[] args) throws IOException {
		reader = new BufferedReader(new InputStreamReader(System.in));
		tokenizer = null;
		writer = new PrintWriter(System.out);
		solve();
		reader.close();
		writer.close();
	}

	private static void solve() throws IOException {
		int n = nextInt();
		int k = nextInt();
		int last = 0;
		String s = nextToken();
		char[] ch = s.toCharArray();

		boolean made;
		for (int j = k - 1; j >= 0; j--) {
			made = false;
			for (int i = last; i < n - 1; i++) {
				if (ch[i] == '4' && ch[i + 1] == '7') {
					last = last - 1;
					if (last < 0)
						last = 0;
					if (i % 2 == 0) {
						ch[i + 1] = '4';
					} else {
						if (i > 0 && ch[i - 1] == '4') {
							j = j % 2;
						}
						ch[i] = '7';
					}
					made = true;
					last=i;
					break;
				}
			}
			if (made == false)
				break;
		}
		writer.println(ch);
	}
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.HashSet;
import java.util.StringTokenizer;
import java.util.TreeSet;

public class Test {
	static BufferedReader reader;
	static StringTokenizer tokenizer;
	static PrintWriter writer;

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

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

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

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

	public static void main(String[] args) throws IOException {
		reader = new BufferedReader(new InputStreamReader(System.in));
		tokenizer = null;
		writer = new PrintWriter(System.out);
		solve();
		reader.close();
		writer.close();
	}

	private static void solve() throws IOException {
		int n = nextInt();
		int k = nextInt();
		int last = 0;
		String s = nextToken();
		char[] ch = s.toCharArray();

		boolean made;
		for (int j = k - 1; j >= 0; j--) {
			made = false;
			for (int i = last; i < n - 1; i++) {
				last=i;
				if (ch[i] == '4' && ch[i + 1] == '7') {
					last = last - 1;
					if (last < 0)
						last = 0;
					if (i % 2 == 0) {
						ch[i + 1] = '4';
					} else {
						if (i > 0 && ch[i - 1] == '4') {
							j = j % 2;
						}
						ch[i] = '7';
					}
					made = true;
					break;
				}
			}
			if (made == false)
				break;
		}
		writer.println(ch);
	}
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.HashSet;
import java.util.StringTokenizer;
import java.util.TreeSet;

public class Test {
	static BufferedReader reader;
	static StringTokenizer tokenizer;
	static PrintWriter writer;

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

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

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

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

	public static void main(String[] args) throws IOException {
		reader = new BufferedReader(new InputStreamReader(System.in));
		tokenizer = null;
		writer = new PrintWriter(System.out);
		solve();
		reader.close();
		writer.close();
	}

	private static void solve() throws IOException {
		int n = nextInt();
		int k = nextInt();
		int last=0;
		String s = nextToken();
		StringBuffer sb = new StringBuffer(s);

		boolean made;
		for (int j = k-1; j >= 0; j--) {
			made = false;
			for (int i = last; i < n - 1; i++) {
				if (sb.charAt(i) == '4' && sb.charAt(i + 1) == '7') {
					last=last-1;
					if(last<0)
						last=0;
					if (i % 2 == 0) {
						sb.setCharAt(i + 1, '4');
					} else {
						if(i>0&&sb.charAt(i-1)=='4')
						{
							j=j%2;
						}
						sb.setCharAt(i, '7');
					}
					made = true;
					break;
				}
			}
			if (made == false)
				break;
		}
		writer.println(sb.toString());
	}
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.HashSet;
import java.util.StringTokenizer;
import java.util.TreeSet;

public class Test {
	static BufferedReader reader;
	static StringTokenizer tokenizer;
	static PrintWriter writer;

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

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

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

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

	public static void main(String[] args) throws IOException {
		reader = new BufferedReader(new InputStreamReader(System.in));
		tokenizer = null;
		writer = new PrintWriter(System.out);
		solve();
		reader.close();
		writer.close();
	}

	private static void solve() throws IOException {
		int n = nextInt();
		int k = nextInt();
		int last=0;
		String s = nextToken();
		StringBuilder sb = new StringBuilder(s);

		boolean made;
		for (int j = k-1; j >= 0; j--) {
			made = false;
			for (int i = last; i < n - 1; i++) {
				if (sb.charAt(i) == '4' && sb.charAt(i + 1) == '7') {
					last=last-1;
					if(last<0)
						last=0;
					if (i % 2 == 0) {
						sb.setCharAt(i + 1, '4');
					} else {
						if(i>0&&sb.charAt(i-1)=='4')
						{
							j=j%2;
						}
						sb.setCharAt(i, '7');
					}
					made = true;
					break;
				}
			}
			if (made == false)
				break;
		}
		writer.println(sb.toString());
	}
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.HashSet;
import java.util.StringTokenizer;
import java.util.TreeSet;

public class Test {
	static BufferedReader reader;
	static StringTokenizer tokenizer;
	static PrintWriter writer;

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

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

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

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

	public static void main(String[] args) throws IOException {
		reader = new BufferedReader(new InputStreamReader(System.in));
		tokenizer = null;
		writer = new PrintWriter(System.out);
		solve();
		reader.close();
		writer.close();
	}

	private static void solve() throws IOException {
		int n = nextInt();
		int k = nextInt();
		int last=0;
		String s = nextToken();
		StringBuilder sb = new StringBuilder(s);

		boolean made;
		for (int j = k; j > 0; j--) {
			made = false;
			for (int i = last; i < n - 1; i++) {
				if (sb.charAt(i) == '4' && sb.charAt(i + 1) == '7') {
					last=last-1;
					if(last<0)
						last=0;
					if (i % 2 == 0) {
						sb.setCharAt(i + 1, '4');
					} else {
						if(i>0&&sb.charAt(i-1)=='4')
						{
							k=k%2;
						}
						sb.setCharAt(i, '7');
					}
					made = true;
					break;
				}
			}
			if (made == false)
				break;
		}
		writer.println(sb.toString());
	}
}


import java.io.*;
import java.math.*;
import java.util.*;
/*public class TaskB {

}
 */
public class TaskB implements Runnable {
	// based on Petr's template
	private void solve() throws IOException {
		int n = this.nextInt();
		int K = this.nextInt();
		String arrayS = this.nextToken();
		char[] array = arrayS.toCharArray();
		for ( int i = 1; i < n && K > 0; i ++ )
			if ( array[ i - 1 ] == '4' && array[i] == '7' )
				if ( i % 2 == 1 ){
					array[i] = '4';
					K --;
					if ( i + 1 < n && array[ i + 1 ] == '7' ){
						K %= 2;
						if ( K == 1 )
							array[i] = '7';
						K = 0;
					}
				}
				else{
					array[ i - 1 ] = '7';
					K --;
					if ( i - 2 >= 0 && array[ i - 2 ] == '4' ){
						K %= 2;
						if ( K == 1 )
							array[ i - 1 ] = '4';
						K = 0;
					}
				}
		writer.println( new String( array ) );
	}

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

	BufferedReader reader;
	StringTokenizer tokenizer;
	PrintWriter writer;

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

	boolean hasNext() throws IOException {
		while (tokenizer == null || !tokenizer.hasMoreTokens()) {
			String nextLine = reader.readLine();
			if (nextLine == null)
				return false;
			tokenizer = new StringTokenizer(nextLine);
		}

		return true;
	}

	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 nextLine() throws IOException {
		return reader.readLine();
	}

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

		return tokenizer.nextToken();
	}

	BigInteger nextBigInteger() throws IOException {
		while (tokenizer == null || !tokenizer.hasMoreTokens()) {
			tokenizer = new StringTokenizer(reader.readLine());
		}

		return new BigInteger(tokenizer.nextToken());
	}
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.InputMismatchException;
import java.io.Writer;
import java.math.BigInteger;
import java.io.InputStream;

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

class TaskD {
    public void solve(int testNumber, InputReader in, OutputWriter out) {
        int n = in.nextInt();
        int k = in.nextInt();

        String s = in.next();

        char[] a = s.toCharArray();

        for (int i = 0; i < a.length - 1 && k > 0; i++) {
            if (a[i] == '4' && a[i + 1] == '7') {
                if(i % 2 == 0) {
                    a[i] = a[i + 1] = '4';
                }
                else {
                    if(i - 1 < 0 || a[i - 1] != '4'){
                        a[i] = a[i + 1] = '7';
                        i++;
                    } else {
                        if(k % 2 == 1){
                            a[i] = a[i + 1] = '7';
                        }
                        break;
                    }
                }
                k--;
            }
        }

        out.printLine(new String(a));
    }
}

class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar, numChars;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int next_() {
            if (numChars == -1)
                throw new InputMismatchException();
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = next_();
            while (isSpaceChar(c))
                c = next_();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = next_();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = next_();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public String next() {
            int c = next_();
            while (isSpaceChar(c))
                c = next_();
            StringBuffer res = new StringBuffer();
            do {
                res.appendCodePoint(c);
                c = next_();
            } while (!isSpaceChar(c));
            return res.toString();
        }

        private boolean isSpaceChar(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        }

class OutputWriter {
    private final PrintWriter writer;

    public OutputWriter(OutputStream outputStream) {
            writer = new PrintWriter(outputStream);
    }

    public OutputWriter(Writer writer) {
            this.writer = new PrintWriter(writer);
    }

    public void print(Object...objects) {
            for (int i = 0; i < objects.length; i++) {
                    if (i != 0)
                            writer.print(' ');
                    writer.print(objects[i]);
            }
    }

    public void printLine(Object...objects) {
            print(objects);
            writer.println();
    }

    public void close() {
            writer.close();
    }

}


import java.io.BufferedReader;
import java.io.InputStreamReader;

public class B121 {
	public static void main(String[] args) throws Exception {
		BufferedReader r = new BufferedReader(new InputStreamReader(System.in));
		String[] s = r.readLine().split(" ");
		char[] line = r.readLine().toCharArray();
		int n = line.length, k = Integer.parseInt(s[1]);
		int i = 0;
		for (int x = 0; i < k && x + 1 < n;) {
			if (line[x] == '4' && line[x + 1] == '7') {
				if (x % 2 == 0) {
					line[x + 1] = '4';
					if (x + 2 < k) {
						if (line[x + 2] == '7') {
							i += 2 * ((k - i-1) / 2);
						}
					}
					x++;
				} else {
					line[x] = '7';
					if(x>0)
						x--;
				}
				i++;
			} else
				x++;
		}
		System.out.println(new String(line));

	}
}


import java.io.BufferedReader;
import java.io.InputStreamReader;

public class B121 {
	public static void main(String[] args) throws Exception {
		BufferedReader r = new BufferedReader(new InputStreamReader(System.in));
		String[] s = r.readLine().split(" ");
		char[] line = r.readLine().toCharArray();
		int n = line.length, k = Integer.parseInt(s[1]);
		int i = 0;
		for (int x = 0; i < k && x + 1 < n;) {
			if (line[x] == '4' && line[x + 1] == '7') {
				if (x % 2 == 0) {
					line[x + 1] = '4';
					if (x + 2 < n) {
						if (line[x + 2] == '7') {
							i += 2 * ((k - i-1) / 2);
						}
					}
					x++;
				} else {
					line[x] = '7';
					if(x>0)
						x--;
				}
				i++;
			} else
				x++;
		}
		System.out.println(new String(line));

	}
}


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

public class P4 {

	static class Scanner{
		BufferedReader br=null;
		StringTokenizer tk=null;
		public Scanner(){
			br=new BufferedReader(new InputStreamReader(System.in));
		}
		public String next() throws IOException{
			while(tk==null || !tk.hasMoreTokens())
				tk=new StringTokenizer(br.readLine());
			return tk.nextToken();
		}
		public int nextInt() throws NumberFormatException, IOException{
			return Integer.valueOf(next());
		}
	}

	public static void main(String args[]) throws NumberFormatException, IOException{
		Scanner sc = new Scanner();
		int N = sc.nextInt();
		int K = sc.nextInt();
		char[] a = sc.next().toCharArray();
		for(int i = 0; i < N; i++){
			if ((i < N - 1) && a[i]=='4' &&  a[i + 1]=='7'){
				if (i % 2  == 0){
					a[i + 1] = '4';
					K--;
				}
				else{
					if (i>0 && a[i - 1]=='4'){
						//cycle
						K = K % 2;
						if (K == 1)
							a[i] = '7';
						break;
					}
					else{
						a[i] = '7';
						K--;
					}
				}
			}
		}
		System.out.println(new String(a));
	}

}


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

public class P4 {

	static class Scanner{
		BufferedReader br=null;
		StringTokenizer tk=null;
		public Scanner(){
			br=new BufferedReader(new InputStreamReader(System.in));
		}
		public String next() throws IOException{
			while(tk==null || !tk.hasMoreTokens())
				tk=new StringTokenizer(br.readLine());
			return tk.nextToken();
		}
		public int nextInt() throws NumberFormatException, IOException{
			return Integer.valueOf(next());
		}
	}

	public static void main(String args[]) throws NumberFormatException, IOException{
		Scanner sc = new Scanner();
		int N = sc.nextInt();
		int K = sc.nextInt();
		char[] a = sc.next().toCharArray();
		for(int i = 0; i < N; i++){
			if ((i < N - 1) && a[i]=='4' &&  a[i + 1]=='7'){
				if (K == 0)
					continue;
				if (i % 2  == 0){
					a[i + 1] = '4';
					K--;
				}
				else{
					if (i>0 && a[i - 1]=='4'){
						//cycle
						K = K % 2;
						if (K == 1)
							a[i] = '7';
						break;
					}
					else{
						a[i] = '7';
						K--;
					}
				}
			}
		}
		System.out.println(new String(a));
	}

}


import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.StringTokenizer;

public class CodeE
{
	static class Scanner
	{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer("");

		public String nextLine()
		{
			try
			{
				return br.readLine();
			}
			catch(Exception e)
			{
				throw(new RuntimeException());
			}
		}

		public String next()
		{
			while(!st.hasMoreTokens())
			{
				String l = nextLine();
				if(l == null)
					return null;
				st = new StringTokenizer(l);
			}
			return st.nextToken();
		}

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

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

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

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

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

		public double[] nextDoubleArray(int n)
		{
			double[] res = new double[n];
			for(int i = 0; i < res.length; i++)
				res[i] = nextLong();
			return res;
		}
		public void sortIntArray(int[] array)
		{
			Integer[] vals = new Integer[array.length];
			for(int i = 0; i < array.length; i++)
				vals[i] = array[i];
			Arrays.sort(vals);
			for(int i = 0; i < array.length; i++)
				array[i] = vals[i];
		}

		public void sortLongArray(long[] array)
		{
			Long[] vals = new Long[array.length];
			for(int i = 0; i < array.length; i++)
				vals[i] = array[i];
			Arrays.sort(vals);
			for(int i = 0; i < array.length; i++)
				array[i] = vals[i];
		}

		public void sortDoubleArray(double[] array)
		{
			Double[] vals = new Double[array.length];
			for(int i = 0; i < array.length; i++)
				vals[i] = array[i];
			Arrays.sort(vals);
			for(int i = 0; i < array.length; i++)
				array[i] = vals[i];
		}
	}

	static long gcd(long a, long b)
	{
		if(b == 0)
			return a;
		return gcd(b, a % b);
	}

	static final int limite = 1000000000;

	static ArrayList <Long> luckys = new ArrayList <Long> ();

	static void generarLuckys(String acum)
	{
		if(acum.length() == 0 || Long.parseLong(acum) <= limite)
		{
			if(acum.length() != 0)
				luckys.add(Long.parseLong(acum));
			generarLuckys(acum + '4');
			generarLuckys(acum + '7');
		}
	}

	public static void main(String[] args)
	{
		Scanner sc = new Scanner();
		sc.nextInt();
		int k = sc.nextInt();
		char[] s = sc.nextLine().toCharArray();
		LinkedList <Integer> indices = new LinkedList <Integer> ();
		for(int i = 0; i < s.length - 1; i++)
		{
			if(s[i] == '4' && s[i + 1] == '7')
				indices.add(i);
		}
		int cuenta = 0;
		while(!indices.isEmpty() && cuenta < k)
		{
			if(cuenta == 1000000 && ((k & 1) == 0))
				break;
			if(cuenta == 1000001 && ((k & 1) == 1))
				break;
			int actual = indices.pollFirst();
			if(actual < s.length - 1 && s[actual] == '4' && s[actual + 1] == '7')
			{
				if((actual & 1) == 0)
					s[actual] = s[actual + 1] = '4';
				else
					s[actual] = s[actual + 1] = '7';
				if(actual + 2 < s.length && s[actual + 1] == '4' && s[actual + 2] == '7')
					indices.addFirst(actual + 1);
				if(actual - 1 >= 0 && s[actual - 1] == '4' && s[actual] == '7')
					indices.addFirst(actual - 1);
			}
			cuenta++;
		}
		System.out.println(new String(s));
	}
}