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

public class CodeD
{
	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');
		}
	}

	static int n;
	static boolean[] valores;
	static Integer[][][] dp;

	static int dp(int i, boolean anterior, boolean anteriorAnterior)
	{
		if(dp[i][anterior ? 1 : 0][anteriorAnterior ? 1 : 0] != null)
			return dp[i][anterior ? 1 : 0][anteriorAnterior ? 1 : 0];
		if(i == n)
			return dp[i][anterior ? 1 : 0][anteriorAnterior ? 1 : 0] = anterior == anteriorAnterior ? 1 : 0;
		int mejor = 1000000;
		for(int j = 0; j < 4; j++)
		{
			boolean nuevoAnterior = ((j >> 1) & 1) == 1;
			boolean nuevoEste = (j & 1) == 1;
			if((nuevoAnterior != anteriorAnterior) && (valores[i] == anterior))
				mejor = Math.min(mejor, dp(i + 1, nuevoEste, nuevoAnterior) + 1);
		}
		if(anterior != anteriorAnterior)
			mejor = Math.min(mejor, dp(i + 1, valores[i], anterior));
		return dp[i][anterior ? 1 : 0][anteriorAnterior ? 1 : 0] = mejor;
	}
	public static void main(String[] args)
	{
		Scanner sc = new Scanner();
		n = sc.nextInt();
		valores = new boolean[n];
		int actual = 0;
		for(char c : sc.next().toCharArray())
			valores[actual++] = c == '1';
		dp = new Integer[n + 1][2][2];
		int mejor = dp(0, false, false);
		mejor = Math.min(mejor, dp(0, false, true));
		mejor = Math.min(mejor, dp(0, true, false));
		mejor = Math.min(mejor, dp(0, true, true));
		System.out.println(mejor);
	}
}


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)
		{
			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));
	}
}


import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Scanner;
import java.io.BufferedWriter;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Scanner;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class TaskD {
	public static StringBuffer tmp;
	public static int findIndex(int from, int n) {
		for (int i = from; i < n-1; ++i) {
			if (tmp.charAt(i) == '4' && tmp.charAt(i+1) == '7') {
				return i;
			}
		}
		return -1;
	}
	public static void main(String[] args) {
		PrintWriter jout = new PrintWriter(System.out);
		Scanner jin = new Scanner(new InputStreamReader(System.in));
		int n = jin.nextInt();
		int k = jin.nextInt();
		String number = jin.next();
		tmp = new StringBuffer(number);

		if (n == 1 || k == 0) {
			System.out.println(number);
			return;
		}

		int index = 0;
		while ( k>0 && (index = findIndex(index,n)) != -1) {
			if (index % 2 == 0) {
				if (index == n - 2) {
					System.out.println(tmp.substring(0, n-2) + "44");
					return;
				} else if (tmp.charAt(index+2) == '7') {
					if (k % 2 ==0) {
						System.out.println(tmp.substring(0, index+1) + "7" +tmp.substring(index+2));
						return;
					} else {
						System.out.println(tmp.substring(0, index+1) + "4" +tmp.substring(index+2));
						return;
					}
				} else {
					tmp.setCharAt(index+1, '4');
					index++;
					k--;
				}
			}
			else {
					tmp.setCharAt(index, '7');
					index--;
					if (index < 0) {
						break;
					}
					k--;
			}
		}

		System.out.println(tmp);
		jout.close();
	}
}


import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Scanner;
import java.io.BufferedWriter;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Scanner;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class TaskD {
	public static StringBuffer tmp;
	public static int findIndex(int from, int n) {
		for (int i = from; i < n-1; ++i) {
			if (tmp.charAt(i) == '4' && tmp.charAt(i+1) == '7') {
				return i;
			}
		}
		return -1;
	}
	public static void main(String[] args) {
		PrintWriter jout = new PrintWriter(System.out);
		Scanner jin = new Scanner(new InputStreamReader(System.in));
		int n = jin.nextInt();
		int k = jin.nextInt();
		String number = jin.next();
		tmp = new StringBuffer(number);

		if (n == 1 || k == 0) {
			System.out.println(number);
			return;
		}

		int index = 0;
		while ( (index = findIndex(index,n)) != -1) {
			if (index % 2 == 0) {
				if (index == n - 2) {
					System.out.println(tmp.substring(0, n-2) + "44");
					return;
				} else if (tmp.charAt(index+2) == '7') {
					if (k % 2 ==0) {
						System.out.println(tmp.substring(0, index+1) + "7" +tmp.substring(index+2));
						return;
					} else {
						System.out.println(tmp.substring(0, index+1) + "4" +tmp.substring(index+2));
						return;
					}
				} else {
					tmp.setCharAt(index+1, '4');
					index++;
					k--;
				}
			}
			else {
					tmp.setCharAt(index, '7');
					index--;
					if (index < 0) {
						break;
					}
					k--;
			}
		}

		System.out.println(tmp);
		jout.close();
	}
}


import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.Locale;
import java.util.StringTokenizer;

public class B {
    BufferedReader in;
    StringTokenizer st;
    PrintWriter out;

    String _token() throws IOException {
        while (in.ready() && !st.hasMoreTokens()) {
            st = new StringTokenizer(in.readLine());
        }
        return st.nextToken();
    }

    int _int() throws NumberFormatException, IOException {
        return Integer.parseInt(_token());
    }

    long _long() throws NumberFormatException, IOException {
        return Long.parseLong(_token());
    }

    double _double() throws NumberFormatException, IOException {
        return Double.parseDouble(_token());
    }

    void deb(String s) {
        System.err.println(s);
    }

    void deb(Object a) {
        System.err.println(a.toString());
    }

    void init(boolean FILE) throws NumberFormatException, IOException {
        Locale.setDefault(Locale.US);
        if (FILE) {
            in = new BufferedReader(new FileReader("in"));
            out = new PrintWriter("out");
        } else {
            in = new BufferedReader(new InputStreamReader(System.in));
            out = new PrintWriter(System.out);
        }
        st = new StringTokenizer("");
    }

    void solve() throws NumberFormatException, IOException {
        init(true);
        int n = _int();
        int k = _int();
        char c [] = _token().toCharArray();

        while (k > 0) {
            for(int i=0;i<n-1;i++) {
                if (c[i] == '4' && c[i+1] =='7') {
                    if (i%2 == 0) {
                        c[i+1] = '4';
                    } else {
                        c[i] = '7';
                    }
                    k--;
                    break;
                }
            }
        //  deb(new String(c));
        }
        deb(new String(c));
        out.close();
    }

    void mainProgram() throws NumberFormatException, IOException {
        //      test("B.in");
        init(false);
        int n = _int();
        int k = _int();
        char c [] = _token().toCharArray();

        while (k>0) {
            for(int i=0;i<n-1 && k>0; i++) {
                if (k>1 && i+2<n && i%2==0 && c[i+2] == '7'
                        && c[i]=='4' && (c[i+1] == '4' || c[i+1] == '7')) {
                    k%=2;
                    break;
                }
                if (c[i]=='4' && c[i+1] == '7') {
                    if (c[i] == '4' && c[i+1] == '7' && k>0) {
                        if (i%2 == 0) {
                            c[i+1] = '4';
                        } else {
                            c[i] = '7';
                        }
                        k--;
                    }
                }
            }
    //      deb(k);
        }
/*      deb(k);
        while (k > 0) {
            for(int i=0;i<n-1;i++) {
                if (c[i] == '4' && c[i+1] =='7') {
                    if (i%2 == 0) {
                        c[i+1] = '4';
                    } else {
                        c[i] = '7';
                    }
                    k--;
                    break;
                }
            }
            deb(new String(c));
        }
        */
        out.println(new String(c));
        out.close();
    }
    public static void main(String[] args) throws NumberFormatException,
            IOException {
        long T = System.currentTimeMillis();
//      new B().solve();
        new B().mainProgram();
        System.err.println("Time of working: "
                + (System.currentTimeMillis() - T) + " ms");
    }

    int rand(int x) {
        return (int) (Math.random() * x);
    }

    void test(String name) throws IOException {
        out = new PrintWriter(new File(name));

        out.close();
    }

    BigInteger add(BigInteger A, BigInteger B) {
        return A.add(B);
    }

    BigInteger mult(BigInteger A, BigInteger B) {
        return A.multiply(B);
    }

    BigInteger sub(BigInteger A, BigInteger B) {
        return A.subtract(B);
    }

    BigInteger div(BigInteger A, BigInteger B) {
        return A.divide(B);
    }

    BigInteger mi(BigInteger A) {
        return (BigInteger.ZERO).subtract(A);
    }

    BigInteger sq(BigInteger A) {
        return A.multiply(A);
    }

    BigInteger val(long a) {
        return BigInteger.valueOf(a);
    }

    int cmp(BigInteger a, BigInteger b) {
        return a.compareTo(b);
    }

}


import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.Locale;
import java.util.StringTokenizer;

public class B {
    BufferedReader in;
    StringTokenizer st;
    PrintWriter out;

    String _token() throws IOException {
        while (in.ready() && !st.hasMoreTokens()) {
            st = new StringTokenizer(in.readLine());
        }
        return st.nextToken();
    }

    int _int() throws NumberFormatException, IOException {
        return Integer.parseInt(_token());
    }

    long _long() throws NumberFormatException, IOException {
        return Long.parseLong(_token());
    }

    double _double() throws NumberFormatException, IOException {
        return Double.parseDouble(_token());
    }

    void deb(String s) {
        System.err.println(s);
    }

    void deb(Object a) {
        System.err.println(a.toString());
    }

    void init(boolean FILE) throws NumberFormatException, IOException {
        Locale.setDefault(Locale.US);
        if (FILE) {
            in = new BufferedReader(new FileReader("in"));
            out = new PrintWriter("out");
        } else {
            in = new BufferedReader(new InputStreamReader(System.in));
            out = new PrintWriter(System.out);
        }
        st = new StringTokenizer("");
    }

    void solve() throws NumberFormatException, IOException {
        init(true);
        int n = _int();
        int k = _int();
        char c [] = _token().toCharArray();

        while (k > 0) {
            for(int i=0;i<n-1;i++) {
                if (c[i] == '4' && c[i+1] =='7') {
                    if (i%2 == 0) {
                        c[i+1] = '4';
                    } else {
                        c[i] = '7';
                    }
                    k--;
                    break;
                }
            }
        //  deb(new String(c));
        }
        deb(new String(c));
        out.close();
    }

    void mainProgram() throws NumberFormatException, IOException {
        //      test("B.in");
        init(false);
        int n = _int();
        int k = _int();
        char c [] = _token().toCharArray();

        boolean ok = true;
        while (k>0 && ok) {
            ok = false;
            for(int i=0;i<n-1 && k>0 && ok; i++) {

                if (k>1 && i+2<n && i%2==0 && c[i+2] == '7'
                        && c[i]=='4' && (c[i+1] == '4' || c[i+1] == '7')) {
                    k%=2;
                    ok = true;
                    break;
                }

                if (c[i]=='4' && c[i+1] == '7') {
                    if (c[i] == '4' && c[i+1] == '7' && k>0) {
                        if (i%2 == 0) {
                            c[i+1] = '4';
                        } else {
                            c[i] = '7';
                        }
                        k--;
                        ok = true;
                    }
                }
            }
    //      deb(k);
        }
/*      deb(k);
        while (k > 0) {
            for(int i=0;i<n-1;i++) {
                if (c[i] == '4' && c[i+1] =='7') {
                    if (i%2 == 0) {
                        c[i+1] = '4';
                    } else {
                        c[i] = '7';
                    }
                    k--;
                    break;
                }
            }
            deb(new String(c));
        }
        */
        out.println(new String(c));
        out.close();
    }
    public static void main(String[] args) throws NumberFormatException,
            IOException {
        long T = System.currentTimeMillis();
//      new B().solve();
        new B().mainProgram();
        System.err.println("Time of working: "
                + (System.currentTimeMillis() - T) + " ms");
    }

    int rand(int x) {
        return (int) (Math.random() * x);
    }

    void test(String name) throws IOException {
        out = new PrintWriter(new File(name));

        out.close();
    }

    BigInteger add(BigInteger A, BigInteger B) {
        return A.add(B);
    }

    BigInteger mult(BigInteger A, BigInteger B) {
        return A.multiply(B);
    }

    BigInteger sub(BigInteger A, BigInteger B) {
        return A.subtract(B);
    }

    BigInteger div(BigInteger A, BigInteger B) {
        return A.divide(B);
    }

    BigInteger mi(BigInteger A) {
        return (BigInteger.ZERO).subtract(A);
    }

    BigInteger sq(BigInteger A) {
        return A.multiply(A);
    }

    BigInteger val(long a) {
        return BigInteger.valueOf(a);
    }

    int cmp(BigInteger a, BigInteger b) {
        return a.compareTo(b);
    }

}


import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.Locale;
import java.util.StringTokenizer;

public class B {
    BufferedReader in;
    StringTokenizer st;
    PrintWriter out;

    String _token() throws IOException {
        while (in.ready() && !st.hasMoreTokens()) {
            st = new StringTokenizer(in.readLine());
        }
        return st.nextToken();
    }

    int _int() throws NumberFormatException, IOException {
        return Integer.parseInt(_token());
    }

    long _long() throws NumberFormatException, IOException {
        return Long.parseLong(_token());
    }

    double _double() throws NumberFormatException, IOException {
        return Double.parseDouble(_token());
    }

    void deb(String s) {
        System.err.println(s);
    }

    void deb(Object a) {
        System.err.println(a.toString());
    }

    void init(boolean FILE) throws NumberFormatException, IOException {
        Locale.setDefault(Locale.US);
        if (FILE) {
            in = new BufferedReader(new FileReader("in"));
            out = new PrintWriter("out");
        } else {
            in = new BufferedReader(new InputStreamReader(System.in));
            out = new PrintWriter(System.out);
        }
        st = new StringTokenizer("");
    }

    void solve() throws NumberFormatException, IOException {
        init(true);
        int n = _int();
        int k = _int();
        char c [] = _token().toCharArray();

        while (k > 0) {
            for(int i=0;i<n-1;i++) {
                if (c[i] == '4' && c[i+1] =='7') {
                    if (i%2 == 0) {
                        c[i+1] = '4';
                    } else {
                        c[i] = '7';
                    }
                    k--;
                    break;
                }
            }
        //  deb(new String(c));
        }
        deb(new String(c));
        out.close();
    }

    void mainProgram() throws NumberFormatException, IOException {
        //      test("B.in");
        init(false);
        int n = _int();
        int k = _int();
        char c [] = _token().toCharArray();

        boolean ok = true;
        while (k>0 && ok) {
            ok = false;
            for(int i=0;i<n-1 && k>0; i++) {

                if (k>1 && i+2<n && i%2==0 && c[i+2] == '7'
                        && c[i]=='4' && (c[i+1] == '4' || c[i+1] == '7')) {
                    k%=2;
                    ok = true;
                    break;
                }

                if (c[i]=='4' && c[i+1] == '7') {
                    if (c[i] == '4' && c[i+1] == '7' && k>0) {
                        if (i%2 == 0) {
                            c[i+1] = '4';
                        } else {
                            c[i] = '7';
                        }
                        k--;
                        ok = true;
                    }
                }
            }
    //      deb(k);
        }
/*      deb(k);
        while (k > 0) {
            for(int i=0;i<n-1;i++) {
                if (c[i] == '4' && c[i+1] =='7') {
                    if (i%2 == 0) {
                        c[i+1] = '4';
                    } else {
                        c[i] = '7';
                    }
                    k--;
                    break;
                }
            }
            deb(new String(c));
        }
        */
        out.println(new String(c));
        out.close();
    }
    public static void main(String[] args) throws NumberFormatException,
            IOException {
        long T = System.currentTimeMillis();
//      new B().solve();
        new B().mainProgram();
        System.err.println("Time of working: "
                + (System.currentTimeMillis() - T) + " ms");
    }

    int rand(int x) {
        return (int) (Math.random() * x);
    }

    void test(String name) throws IOException {
        out = new PrintWriter(new File(name));

        out.close();
    }

    BigInteger add(BigInteger A, BigInteger B) {
        return A.add(B);
    }

    BigInteger mult(BigInteger A, BigInteger B) {
        return A.multiply(B);
    }

    BigInteger sub(BigInteger A, BigInteger B) {
        return A.subtract(B);
    }

    BigInteger div(BigInteger A, BigInteger B) {
        return A.divide(B);
    }

    BigInteger mi(BigInteger A) {
        return (BigInteger.ZERO).subtract(A);
    }

    BigInteger sq(BigInteger A) {
        return A.multiply(A);
    }

    BigInteger val(long a) {
        return BigInteger.valueOf(a);
    }

    int cmp(BigInteger a, BigInteger b) {
        return a.compareTo(b);
    }

}


import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.Locale;
import java.util.StringTokenizer;

public class B {
    BufferedReader in;
    StringTokenizer st;
    PrintWriter out;

    String _token() throws IOException {
        while (in.ready() && !st.hasMoreTokens()) {
            st = new StringTokenizer(in.readLine());
        }
        return st.nextToken();
    }

    int _int() throws NumberFormatException, IOException {
        return Integer.parseInt(_token());
    }

    long _long() throws NumberFormatException, IOException {
        return Long.parseLong(_token());
    }

    double _double() throws NumberFormatException, IOException {
        return Double.parseDouble(_token());
    }

    void deb(String s) {
        System.err.println(s);
    }

    void deb(Object a) {
        System.err.println(a.toString());
    }

    void init(boolean FILE) throws NumberFormatException, IOException {
        Locale.setDefault(Locale.US);
        if (FILE) {
            in = new BufferedReader(new FileReader("in"));
            out = new PrintWriter("out");
        } else {
            in = new BufferedReader(new InputStreamReader(System.in));
            out = new PrintWriter(System.out);
        }
        st = new StringTokenizer("");
    }

    void solve() throws NumberFormatException, IOException {
        init(true);
        int n = _int();
        int k = _int();
        char c [] = _token().toCharArray();

        while (k > 0) {
            for(int i=0;i<n-1;i++) {
                if (c[i] == '4' && c[i+1] =='7') {
                    if (i%2 == 0) {
                        c[i+1] = '4';
                    } else {
                        c[i] = '7';
                    }
                    k--;
                    break;
                }
            }
            deb(new String(c));
        }
        out.println(new String(c));
        out.close();
    }

    void mainProgram() throws NumberFormatException, IOException {
        //      test("B.in");
        init(true);
        int n = _int();
        int k = _int();
        char c [] = _token().toCharArray();

        while (k>0) {
            for(int i=0;i<n-1 && k>0; i++) {
                if (c[i]=='4' && c[i+1] == '7') {
                    if (i+2<n && i%2==0 && c[i+2] == '7'
                            && (c[i+1] == '4' || c[i+1] == '7')) {
            //          deb("OK");
                        k%=2;
                    }

                    if (c[i] == '4' && c[i+1] == '7' && k>0) {
                        if (i%2 == 0) {
                            c[i+1] = '4';
                        } else {
                            c[i] = '7';
                        }
                        k--;
                    }
                }
            }
    //      deb(k);
        }
/*      deb(k);
        while (k > 0) {
            for(int i=0;i<n-1;i++) {
                if (c[i] == '4' && c[i+1] =='7') {
                    if (i%2 == 0) {
                        c[i+1] = '4';
                    } else {
                        c[i] = '7';
                    }
                    k--;
                    break;
                }
            }
            deb(new String(c));
        }
        */
        out.println(new String(c));
        out.close();
    }
    public static void main(String[] args) throws NumberFormatException,
            IOException {
        long T = System.currentTimeMillis();
        new B().mainProgram();
        System.err.println("Time of working: "
                + (System.currentTimeMillis() - T) + " ms");
    }

    int rand(int x) {
        return (int) (Math.random() * x);
    }

    void test(String name) throws IOException {
        out = new PrintWriter(new File(name));

        out.close();
    }

    BigInteger add(BigInteger A, BigInteger B) {
        return A.add(B);
    }

    BigInteger mult(BigInteger A, BigInteger B) {
        return A.multiply(B);
    }

    BigInteger sub(BigInteger A, BigInteger B) {
        return A.subtract(B);
    }

    BigInteger div(BigInteger A, BigInteger B) {
        return A.divide(B);
    }

    BigInteger mi(BigInteger A) {
        return (BigInteger.ZERO).subtract(A);
    }

    BigInteger sq(BigInteger A) {
        return A.multiply(A);
    }

    BigInteger val(long a) {
        return BigInteger.valueOf(a);
    }

    int cmp(BigInteger a, BigInteger b) {
        return a.compareTo(b);
    }

}


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

public class Prob121B
{
    public static void main( String[] Args ) throws IOException
    {
        BufferedReader br = new BufferedReader( new InputStreamReader( System.in ) );
        StringTokenizer st = new StringTokenizer( br.readLine() );
        int length = Integer.parseInt( st.nextToken() );
        int changes = Integer.parseInt( st.nextToken() );

        boolean repeatable = false;
        char[] array = br.readLine().toCharArray();

        for ( int i = 0; i < length - 1 && changes > 0; i++ )
        {
            if ( array[i] == '4' && array[i + 1] == '7' )
            {
                changes--;
                if ( i % 2 == 0 )
                {
                    array[i + 1] = '4';
                    if ( repeatable )
                        changes -= ( changes / 2 ) * 2;
                }
                else
                {
                    array[i] = '7';
                    i -= 2;
                    repeatable = true;
                }
            }
            else
                repeatable = false;
        }

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


import java.util.Scanner;

public class Prob121B
{
    public static void main( String[] Args )
    {
        Scanner scan = new Scanner( System.in );
        scan.nextInt();
        int changes = scan.nextInt();
        StringBuffer sb = new StringBuffer( scan.next() );

        for ( int i = 0; i < changes; i++ )
        {
            int j = sb.indexOf( "47" );
            if ( j >= 0 )
                if ( j % 2 == 1 )
                    sb.setCharAt( j, '7' );
                else
                    sb.setCharAt( j + 1, '4' );
        }

        System.out.println( sb );
    }
}


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

public class Prob121B
{
    public static void main( String[] Args ) throws IOException
    {
        BufferedReader br = new BufferedReader( new InputStreamReader( System.in ) );
        StringTokenizer st = new StringTokenizer( br.readLine() );
        int length = Integer.parseInt( st.nextToken() );
        int changes = Integer.parseInt( st.nextToken() );

        boolean repeatable = false;
        char[] array = br.readLine().toCharArray();

        for ( int i = 0; i < length - 1 && changes > 0; i++ )
        {
            if ( array[i] == '4' && array[i + 1] == '7' )
            {
                if ( i % 2 == 0 )
                {
                    array[i + 1] = '4';
                    if ( repeatable )
                        changes -= ( changes / 2 ) * 2;
                }
                else
                {
                    array[i] = '7';
                    i -= 2;
                    repeatable = true;
                }
                changes--;
            }
            else
                repeatable = false;
        }

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


import java.util.Scanner;

public class Prob121B
{
    public static void main( String[] Args )
    {
        Scanner scan = new Scanner( System.in );
        scan.nextInt();
        int changes = scan.nextInt();
        StringBuffer sb = new StringBuffer( scan.next() );

        for ( int i = 0; i < changes; i++ )
        {
            int j = sb.indexOf( "47" );
            if ( j >= 0 )
            {
                if ( j % 2 == 1 )
                {
                    sb.setCharAt( j, '7' );
                    if ( sb.substring( j - 1, j + 2 ).equals( "477" ) )
                    {
                        if ( ( changes - i ) % 2 == 0 )
                            sb.setCharAt( j, '4' );
                        break;
                    }
                }
                else
                {
                    sb.setCharAt( j + 1, '4' );
                }
            }
            else
            {
                break;
            }
        }

        System.out.println( sb );
    }
}


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

public class Prob121B
{
    public static void main( String[] Args ) throws IOException
    {
        BufferedReader br = new BufferedReader( new InputStreamReader( System.in ) );
        StringTokenizer st = new StringTokenizer( br.readLine() );
        st.nextToken();
        int changes = Integer.parseInt( st.nextToken() );
        StringBuffer sb = new StringBuffer( br.readLine() );

        int j = 0;

        for ( int i = 0; i < changes; i++ )
        {
            j = sb.indexOf( "47", Math.min( 0, j - 1 ) );
            if ( j >= 0 )
            {
                if ( j % 2 == 1 )
                {
                    sb.setCharAt( j, '7' );
                    if ( sb.substring( j - 1, j + 2 ).equals( "477" ) )
                    {
                        if ( ( changes - i ) % 2 == 0 )
                            sb.setCharAt( j, '4' );
                        break;
                    }
                }
                else
                {
                    sb.setCharAt( j + 1, '4' );
                }
            }
            else
            {
                break;
            }
        }

        System.out.println( sb );
    }
}


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

public class Prob121B
{
    public static void main( String[] Args ) throws IOException
    {
        BufferedReader br = new BufferedReader( new InputStreamReader( System.in ) );
        StringTokenizer st = new StringTokenizer( br.readLine() );
        st.nextToken();
        int changes = Integer.parseInt( st.nextToken() );
        StringBuffer sb = new StringBuffer( br.readLine() );

        for ( int i = 0; i < changes; i++ )
        {
            int j = sb.indexOf( "47" );
            if ( j >= 0 )
            {
                if ( j % 2 == 1 )
                {
                    sb.setCharAt( j, '7' );
                    if ( sb.substring( j - 1, j + 2 ).equals( "477" ) )
                    {
                        if ( ( changes - i ) % 2 == 0 )
                            sb.setCharAt( j, '4' );
                        break;
                    }
                }
                else
                {
                    sb.setCharAt( j + 1, '4' );
                }
            }
            else
            {
                break;
            }
        }

        System.out.println( sb );
    }
}


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

public class D {
    public static void main(String[] args) throws IOException {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        String split[] = in.readLine().split(" ");
        int n = Integer.parseInt(split[0]), k = Integer.parseInt(split[1]);
        StringBuilder num = new StringBuilder(in.readLine());

        for (int i = 0, len = num.length(), c = 0; i < len - 1 && c < k; ) {
            if (num.charAt(i) == '4' && num.charAt(i + 1) == '7') {
                if ((i + 1) % 2 == 1) {
                    num.setCharAt(i + 1, '4');
                    i++;
                    c++;
                } else {
                    num.setCharAt(i, '7');
                    c++;
                    if (i - 1 >= 0 && num.charAt(i - 1) == '4') {
                        if ((k - c) % 2 == 1) {
                            num.setCharAt(i, '4');
                        }
                        i--;
                        break;
                    } else {
                        i += 2;
                    }
                }
            } else
                i++;
        }
        System.out.println(num.toString());
    }
}


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

public class Main implements Runnable
{
    BufferedReader reader;
    StringTokenizer strtok;

    void solve() throws Exception
    {
        int n = nextInt(), k = nextInt();
        char[] num = reader.readLine().toCharArray();
        PriorityQueue<Integer> fourtysevens = new PriorityQueue<Integer>();
        for (int i = 0; i < n - 1; i++)
        {
            if (num[i] == '4' && num[i + 1] == '7')
            {
                fourtysevens.offer(i);
            }
        }

        for (int i = 0; i < Math.min(n, k); i++)
        {
            int pos = fourtysevens.poll();
            if (pos % 2 == 0)
            {
                num[pos + 1] = '4';
                if (pos + 2 < n && num[pos + 2] == '7')
                {
                    fourtysevens.offer(pos + 1);
                }
            }
            else
            {
                num[pos] = '7';
                if (pos - 1 >= 0 && num[pos - 1] == '4')
                {
                    fourtysevens.offer(pos - 1);
                }
            }
        }

        int posfinal = -1;
        int finalnum = -1;
        for (int i = 0; i < n - 2; i++)
        {
            if (i % 2 == 0 && num[i] == '4' && num[i + 1] == '4' && num[i + 2] == '7')
            {
                posfinal = i;
                finalnum = 447;
                break;
            }
            else if (i % 2 == 0 && num[i] == '4' && num[i + 1] == '7' && num[i + 2] == '7')
            {
                posfinal = i;
                finalnum = 477;
                break;
            }
        }

        if (posfinal != -1 && n < k)
        {
            if ((k - n) % 2 == 1)
            {
                if (finalnum == 447)
                {
                    num[posfinal + 1] = '7';
                }
                else
                {
                    num[posfinal + 1] = '4';
                }
            }
        }

        System.out.println(num);
    }

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

    @Override
    public void run()
    {
        try
        {
            if (System.getProperty("ONLINE_JUDGE") == null)
            {
                System.setIn(new FileInputStream("input.txt"));
                System.setOut(new PrintStream("output.txt"));
            }
            reader = new BufferedReader(new InputStreamReader(System.in));
            solve();
        }
        catch (Exception e)
        {
            e.printStackTrace();
        }
    }

    String nextToken() throws IOException
    {
        if (strtok == null || !strtok.hasMoreTokens())
        {
            strtok = new StringTokenizer(reader.readLine());
        }
        return strtok.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());
    }
}


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

public class Main implements Runnable
{
    BufferedReader reader;
    StringTokenizer strtok;

    void solve() throws Exception
    {
        int n = nextInt(), k = nextInt();
        char[] num = reader.readLine().toCharArray();
        PriorityQueue<Integer> fourtysevens = new PriorityQueue<Integer>();
        for (int i = 0; i < n - 1; i++)
        {
            if (num[i] == '4' && num[i + 1] == '7')
            {
                fourtysevens.offer(i);
            }
        }

        for (int i = 0; i < Math.min(n, k); i++)
        {
            int pos = fourtysevens.poll();
            if (pos % 2 == 0)
            {
                num[pos + 1] = '4';
                if (pos + 2 < n && num[pos + 2] == '7')
                {
                    fourtysevens.offer(pos + 1);
                }
            }
            else
            {
                num[pos] = '7';
                if (pos - 1 >= 0 && num[pos - 1] == '4')
                {
                    fourtysevens.offer(pos - 1);
                }
            }
        }

        int posfinal = -1;
        int finalnum = -1;
        for (int i = 0; i < n - 2; i++)
        {
            if (i % 2 == 0 && num[i] == '4' && num[i + 1] == '4' && num[i + 2] == '7')
            {
                posfinal = i;
                finalnum = 447;
                break;
            }
            else if (i % 2 == 0 && num[i] == '4' && num[i + 1] == '7' && num[i + 2] == '7')
            {
                posfinal = i;
                finalnum = 477;
                break;
            }
        }

        if (posfinal != -1 && n < k)
        {
            if ((k - n) % 2 == 1)
            {
                if (finalnum == 447)
                {
                    num[posfinal + 1] = '7';
                }
                else
                {
                    num[posfinal + 1] = '4';
                }
            }
        }

        System.out.println(num);
    }

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

    @Override
    public void run()
    {
        try
        {
            if (System.getProperty("ONLINE_JUDGE") == null)
            {
                System.setIn(new FileInputStream("input.txt"));
                System.setOut(new PrintStream("output.txt"));
            }
            reader = new BufferedReader(new InputStreamReader(System.in));
            solve();
        }
        catch (Exception e)
        {
            e.printStackTrace();
            System.exit(1);
        }
    }

    String nextToken() throws IOException
    {
        if (strtok == null || !strtok.hasMoreTokens())
        {
            strtok = new StringTokenizer(reader.readLine());
        }
        return strtok.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());
    }
}


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

public class Main implements Runnable
{
    BufferedReader reader;
    StringTokenizer strtok;

    void solve() throws Exception
    {
        int n = nextInt(), k = nextInt();
        char[] num = reader.readLine().toCharArray();
        PriorityQueue<Integer> fourtysevens = new PriorityQueue<Integer>();
        for (int i = 0; i < n - 1; i++)
        {
            if (num[i] == '4' && num[i + 1] == '7')
            {
                fourtysevens.offer(i);
            }
        }

        for (int i = 0; i < Math.min(n, k); i++)
        {
            if (fourtysevens.isEmpty())
            {
                break;
            }
            int pos = fourtysevens.poll();
            if (pos % 2 == 0)
            {
                num[pos + 1] = '4';
                if (pos + 2 < n && num[pos + 2] == '7')
                {
                    fourtysevens.offer(pos + 1);
                }
            }
            else
            {
                num[pos] = '7';
                if (pos - 1 >= 0 && num[pos - 1] == '4')
                {
                    fourtysevens.offer(pos - 1);
                }
            }
        }

        int posfinal = -1;
        int finalnum = -1;
        for (int i = 0; i < n - 2; i++)
        {
            if (i % 2 == 0 && num[i] == '4' && num[i + 1] == '4' && num[i + 2] == '7')
            {
                posfinal = i;
                finalnum = 447;
                break;
            }
            else if (i % 2 == 0 && num[i] == '4' && num[i + 1] == '7' && num[i + 2] == '7')
            {
                posfinal = i;
                finalnum = 477;
                break;
            }
        }

        if (posfinal != -1 && n < k)
        {
            if ((k - n) % 2 == 1)
            {
                if (finalnum == 447)
                {
                    num[posfinal + 1] = '7';
                }
                else
                {
                    num[posfinal + 1] = '4';
                }
            }
        }

        System.out.println(num);
    }

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

    @Override
    public void run()
    {
        try
        {
            if (System.getProperty("ONLINE_JUDGE") == null)
            {
                System.setIn(new FileInputStream("input.txt"));
                System.setOut(new PrintStream("output.txt"));
            }
            reader = new BufferedReader(new InputStreamReader(System.in));
            solve();
        }
        catch (Exception e)
        {
            e.printStackTrace();
        }
    }

    String nextToken() throws IOException
    {
        if (strtok == null || !strtok.hasMoreTokens())
        {
            strtok = new StringTokenizer(reader.readLine());
        }
        return strtok.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());
    }
}


package zA;

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

public class Task {
	StreamTokenizer input;
	PrintWriter output;

	int n, m;
	StringBuilder str;

	void Run() throws IOException {
		input.nextToken();
		n=(int)input.nval;
		input.nextToken();
		m=(int)input.nval;
		input.ordinaryChars('0', '9');
		input.wordChars('0','9');
		//input.parseNumbers();
		input.nextToken();
		str=new StringBuilder(input.sval);
		for(int i=0;i<n-1 && m>0;++i) {
			if(str.charAt(i)=='4' && str.charAt(i+1)=='7') {
				if((i&1)==0) {
					if(i<n-2 && str.charAt(i+2)=='7')
						m&=1;
					if(m==0)
						break;
					str.setCharAt(i+1, '4');
				} else {
					if(i>0 && str.charAt(i-1)=='4')
						m&=1;
					if(m==0)
						break;
					str.setCharAt(i, '7');
				}
				m--;
			}
		}
		output.print(str.toString());
	}

	public static void main(String[] args) throws IOException {
		boolean onJudge=System.getProperty("ONLINE_JUDGE")!=null;
		Reader reader=onJudge ? new InputStreamReader(System.in) : new FileReader("input.txt");
		Writer writer=new OutputStreamWriter(System.out);
		Task task=new Task();
		task.input=new StreamTokenizer(new BufferedReader(reader));
		task.output=new PrintWriter(writer);
		task.Run();
		writer.close();
	}
}


//package zA;

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

public class Task {
	StreamTokenizer input;
	PrintWriter output;

	int n, m;
	StringBuilder str;

	void Run() throws IOException {
		input.nextToken();
		n=(int)input.nval;
		input.nextToken();
		m=(int)input.nval;
		input.ordinaryChars('0', '9');
		input.wordChars('0','9');
		//input.parseNumbers();
		input.nextToken();
		str=new StringBuilder(input.sval);
		for(int i=0;i<n-1 && m>0;++i) {
			if(str.charAt(i)=='4' && str.charAt(i+1)=='7') {
				if((i&1)==0) {
					if(i<n-2 && str.charAt(i+2)=='7')
						m&=1;
					if(m==0)
						break;
					str.setCharAt(i+1, '4');
				} else {
					if(i>0 && str.charAt(i-1)=='4')
						m&=1;
					if(m==0)
						break;
					str.setCharAt(i, '7');
				}
				m--;
			}
		}
		output.print(str.toString());
	}

	public static void main(String[] args) throws IOException {
		boolean onJudge=System.getProperty("ONLINE_JUDGE")!=null;
		Reader reader=onJudge ? new InputStreamReader(System.in) : new FileReader("input.txt");
		Writer writer=new OutputStreamWriter(System.out);
		Task task=new Task();
		task.input=new StreamTokenizer(new BufferedReader(reader));
		task.output=new PrintWriter(writer);
		task.Run();
		writer.close();
	}
}


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

public class D {
    public static void main(String[] args) throws IOException {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        String[] S = in.readLine().split(" ");
        int k = Integer.parseInt(S[1]);
        char[] A = in.readLine().toCharArray();
        int i = 0;
        while (i < A.length - 1 && k > 0) {
            i++;
            if (A[i - 1] != '4' || A[i] != '7')
                continue;
            k--;
            if (i % 2 == 1)
                A[i] = '4';
            else {
                A[i - 1] = '7';
                if (i > 1) {
                    if (A[i - 2] == '4') {
                        if (k % 2 == 1)
                            A[i - 1] = '4';
                        break;
                    }
                    i -= 2;
                }
            }
        }
        System.out.println(new String(A));
    }
}


import java.io.*;
import java.util.*;
public class lucksum {
	static int find(StringBuilder s,int start)
	{
		int res=-1;
		for(int i=start;i<s.length()-1;i++)
		{
			if((s.charAt(i)=='4')&&(s.charAt(i+1)=='7'))
				return i;
		}
		return res;
	}
	public static void main(String[] args)
	{
		 Scanner fin = new Scanner(System.in);
		 String s=fin.nextLine();
		 String[] ss=s.split(" ");
	//	 int n=Integer.parseInt(ss[0]);
		 int k=Integer.parseInt(ss[1]);
		 s=fin.nextLine();
		 StringBuilder sb=new StringBuilder(s);
		 int step=0;
		 for(int i=0;i<s.length()-1;)
		 {
			 if(step==k)
			 {
				 System.out.print(sb);
				 return;
			 }
			 int start=find(sb,i);
			 if(start==-1){
				 System.out.print(sb);
				 return;
			 }
			 step++;
			 if(start%2==0)
			 {
				 sb.setCharAt(start, '4');
				 sb.setCharAt(start+1, '4');
			 } else {
				 sb.setCharAt(start, '7');
				 sb.setCharAt(start+1, '7');
				 if(sb.charAt(start-1)=='4')
				 {
					 k=k-step;
					 k%=2;
					 step=0;
					 i=start-1;
					 continue;
				 }
			 }
			 i=start+1;
		 }
		 System.out.print(sb);
		 return;

	}
}


import java.io.*;
import java.util.*;
public class lucksum {
	static int find(StringBuilder s,int start)
	{
		int res=-1;
		for(int i=start;i<s.length()-1;i++)
		{
			if((s.charAt(i)=='4')&&(s.charAt(i+1)=='7'))
				return i;
		}
		return res;
	}
	public static void main(String[] args)
	{
		 Scanner fin = new Scanner(System.in);
		 int n=fin.nextInt();
		 int k=fin.nextInt();
		 String s=fin.nextLine();
		 s=fin.nextLine();
		 StringBuilder sb=new StringBuilder(s);
		 Map m=new HashMap<String,Integer>();
		 int step=0;
		 m.put(sb.toString(), step);
		 int start=0;
		 do{
			 if(step==k){
				 System.out.println(sb.toString());
				 return ;
			 }
			 start=find(sb,start);
			 if(start==-1)
			 {
				 System.out.println(sb.toString());
				 return ;
			 }
			 if(start%2==0)
			 {
				 sb.setCharAt(start, '4');
				 sb.setCharAt(start+1, '4');
			 }
			 else
			 {
				 sb.setCharAt(start, '7');
				 sb.setCharAt(start+1, '7');
			 }
			 if(start>0)
				 start=start-1;
			 step++;
			 if(m.containsKey(sb.toString())){
				 int first=(Integer)m.get(sb.toString());
				 int loop=step-first;
				 k=(k-first)%loop;
				 step=0;
				 m.clear();
			 }else{
				 m.put(sb.toString(), step);
			 }
		 }while(true);

	}
}


import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.StringTokenizer;

/**
 *
 *
 * 3 2 3 5
 * -2 -1 4 -1 2 7 3
 *
 *
 * @author pttrung
 */
public class D {

    public static long MOD = 100000000;
    public static double[][][] dp;

    public static void main(String[] args) throws FileNotFoundException {
        PrintWriter out;

        Scanner in = new Scanner();
        //out = new PrintWriter(new FileOutputStream(new File("output.txt")));
        out = new PrintWriter(System.out);
        int n = in.nextInt();
        int k = in.nextInt();
        //  int[]result = new int[n];
        String line = in.next();
        for (int i = 0; i < n; i++) {
            if (i + 1 < n && k > 0) {

                int a = line.charAt(i) - '0';
                int b = line.charAt(i + 1) - '0';
                if (a == 4 && b == 7) {
                    if (i % 2 == 0) {
                        if (i + 2 < n) {
                            int next = line.charAt(i + 2) - '0';
                            if (next == 7) {
                                if (k % 2 == 0) {
                                    out.print(47);
                                } else {
                                    out.print(44);
                                }
                                k = 0;
                            } else {
                                out.print(44);
                            }
                        } else {
                            out.print(44);
                        }
                    } else {
                        if (i > 0) {
                            int last = line.charAt(i - 1) - '0';
                            if (last == 4) {
                                if (k % 2 == 0) {
                                    out.print(47);
                                } else {
                                    out.print(77);
                                }
                                k = 0;
                            } else {
                                out.print(77);
                            }
                        } else {
                            out.print(77);
                        }

                    }
                    k--;
                    i++;
                } else {
                    out.print(a);
                }

            } else {
                out.print(line.charAt(i));
            }
        }
        out.close();

    }

    public static double cal(int p, int w, int b) {
        // System.out.println(w + " " + b + " " + p);
        if (w == 0) {
            return 0;
        }
        if (b == 0) {
            if (w != 0) {
                if (p == 1) {
                    return 1;
                } else {
                    return 0;
                }
            } else {
                return 0;
            }
        }
        if (dp[p][w][b] != -1) {
            return dp[p][w][b];
        }
        if (p == 1) {
            double result = (double) w / (w + b);
            result += (1 - result) * cal(0, w, b - 1);
            return dp[p][w][b] = result;
        } else {
            double result = (double) b / (w + b);
            if (b > 1 && w > 0) {
                double c = (double) w / (w + b - 1);
                double d = (double) (b - 1) / (w + b - 1);
                result = result * ((c * cal(1, w - 1, b - 1)) + (d * cal(1, w, b - 2)));
            } else if (w > 0) {
                result = result * cal(1, w - 1, b - 1);
            }
            return dp[p][w][b] = result;
        }

    }

    public static double dist(Point a, Point b) {
        double val = (a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y);
        return Math.sqrt(val);
    }

    public static double dist(long a, long b, long x, long y) {
        double val = (b - a) * (b - a) + (x - y) * (x - y);
        val = Math.sqrt(val);
        double other = x * x + a * a;
        other = Math.sqrt(other);
        return val + other;
    }

    public static class Point {

        int x, y;

        public Point(int x, int y) {
            this.x = x;
            this.y = y;
        }
    }

    public static class FT {

        int[] data;

        FT(int n) {
            data = new int[n];
        }

        public void update(int index, int value) {
            while (index < data.length) {
                data[index] += value;
                index += (index & (-index));
            }
        }

        public int get(int index) {
            int result = 0;
            while (index > 0) {
                result += data[index];
                index -= (index & (-index));
            }
            return result;

        }
    }

    public static class Sign {

        char c;
        int x, y;

        public Sign(char c, int x, int y) {
            this.c = c;
            this.x = x;
            this.y = y;
        }
    }

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

    public static long pow(long a, long b) {
        if (b == 0) {
            return 1;
        }
        if (b == 1) {
            return a;
        }
        long val = pow(a, b / 2);
        if (b % 2 == 0) {
            return val * val % MOD;
        } else {
            return val * (val * a % MOD) % MOD;
        }
    }

    static class Scanner {

        BufferedReader br;
        StringTokenizer st;

        public Scanner() throws FileNotFoundException {
            // System.setOut(new PrintStream(new BufferedOutputStream(System.out), true));
            br = new BufferedReader(new InputStreamReader(System.in));
            //br = new BufferedReader(new InputStreamReader(new FileInputStream(new File("input.txt"))));
        }

        public String next() {

            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (Exception e) {
                    throw new RuntimeException();
                }
            }
            return st.nextToken();
        }

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

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

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

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

        public boolean endLine() {
            try {
                String next = br.readLine();
                while (next != null && next.trim().isEmpty()) {
                    next = br.readLine();
                }
                if (next == null) {
                    return true;
                }
                st = new StringTokenizer(next);
                return st.hasMoreTokens();
            } catch (Exception e) {
                throw new RuntimeException();
            }
        }
    }
}


import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.HashMap;
import java.util.StringTokenizer;
import java.util.TreeMap;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
/**
 * 6
 * 1 0
 * 0 0
 * 0 0
 * 1 1
 * 0 1
 * 1 1
 *
 * @author pttrung
 */
public class B {

    public static boolean circle;
    public static int[][] dp;
    public static int[] x = {0, 1, 0, -1};
    public static int[] y = {1, 0, -1, 0};

    public static void main(String[] args) throws FileNotFoundException {
        PrintWriter out;

        Scanner in = new Scanner();
        //out = new PrintWriter(new FileOutputStream(new File("output.txt")));
        out = new PrintWriter(System.out);
        long n = in.nextInt();
        long m = in.nextInt();
        long k = in.nextInt();
        int mod = 1000000007;
        if (k > n || k == 1) {
            long result = 1;
            for (int i = 0; i < n; i++) {
                result *= m;
                result %= mod;
            }
            out.println(result % mod);
        } else {
            if (n == k) {
                int count = (int) Math.ceil((double) n / 2);
                long result = 1;
                for (int i = 0; i < count; i++) {
                    result *= m;
                    result %= mod;
                }
                out.println(result % mod);
            } else if (n > k) {
                if (k % 2 == 0) {
                    out.println(m);
                } else {
                    long result = m * (m - 1);
                    result %= mod;
                    result += m;
                    out.println(result);
                }
            }
        }
        out.close();
    }

    public static Line getLine(Point a, Point b) {
        int c = (a.x - b.x);
        int d = (a.y - b.y);
        if (c == 0) {
            return new Line(1, 0, -a.x);
        } else if (d == 0) {
            return new Line(0, 1, -a.y);
        } else {
            double rate = (double) (-d) / c;

            double other = ((double) rate * a.x) + a.y;
            //System.out.println(a + "|" + b + ": " + rate + " " + other);
            return new Line(rate, 1, -other);
        }
    }

    public static class Line {

        double a, b, c;

        public Line(double a, double b, double c) {
            this.a = a;
            this.b = b;
            this.c = c;
        }

        @Override
        public int hashCode() {
            int hash = 7;
            hash = 47 * hash + (int) (Double.doubleToLongBits(this.a) ^ (Double.doubleToLongBits(this.a) >>> 32));
            hash = 47 * hash + (int) (Double.doubleToLongBits(this.b) ^ (Double.doubleToLongBits(this.b) >>> 32));
            hash = 47 * hash + (int) (Double.doubleToLongBits(this.c) ^ (Double.doubleToLongBits(this.c) >>> 32));
            return hash;
        }

        @Override
        public boolean equals(Object obj) {
            if (obj == null) {
                return false;
            }
            if (getClass() != obj.getClass()) {
                return false;
            }
            final Line other = (Line) obj;
            if (Double.doubleToLongBits(this.a) != Double.doubleToLongBits(other.a)) {
                return false;
            }
            if (Double.doubleToLongBits(this.b) != Double.doubleToLongBits(other.b)) {
                return false;
            }
            if (Double.doubleToLongBits(this.c) != Double.doubleToLongBits(other.c)) {
                return false;
            }
            return true;
        }

        @Override
        public String toString() {
            return a + " " + b + " " + c;
        }
    }

    static class FT {

        int[] data;

        FT(int n) {
            data = new int[n];
        }

        void update(int index, int val) {
            // System.out.println("UPDATE INDEX " + index);
            while (index < data.length) {
                data[index] += val;
                index += index & (-index);

                //    System.out.println("NEXT " +index);
            }
        }

        int get(int index) {
            //  System.out.println("GET INDEX " + index);
            int result = 0;
            while (index > 0) {
                result += data[index];
                index -= index & (-index);
                // System.out.println("BACK " + index);
            }
            return result;
        }
    }

    public static double dist(Point a, Point b) {
        double val = (a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y);
        return Math.sqrt(val);
    }

    public static class Point {

        int x, y;

        public Point(int x, int y) {
            this.x = x;
            this.y = y;
        }

        @Override
        public String toString() {
            return x + " " + y;
        }
    }

    public static boolean nextPer(int[] data) {
        int i = data.length - 1;
        while (i > 0 && data[i] < data[i - 1]) {
            i--;
        }
        if (i == 0) {
            return false;
        }
        int j = data.length - 1;
        while (data[j] < data[i - 1]) {
            j--;
        }
        int temp = data[i - 1];
        data[i - 1] = data[j];
        data[j] = temp;
        Arrays.sort(data, i, data.length);
        return true;
    }

    public static long pow(int a, int b) {
        if (b == 0) {
            return 1;
        }
        if (b == 1) {
            return a;
        }
        long val = pow(a, b / 2);
        if (b % 2 == 0) {
            return val * val;
        } else {
            return val * val * a;
        }
    }

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

    public static long lcm(long a, long b) {
        return a * b / gcd(a, b);
    }

    static class Scanner {

        BufferedReader br;
        StringTokenizer st;

        public Scanner() throws FileNotFoundException {
            // System.setOut(new PrintStream(new BufferedOutputStream(System.out), true));
            br = new BufferedReader(new InputStreamReader(System.in));
            //  br = new BufferedReader(new FileReader(new File("output.txt")));
        }

        public String next() {

            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (Exception e) {
                    throw new RuntimeException();
                }
            }
            return st.nextToken();
        }

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

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

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

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

        public boolean endLine() {
            try {
                String next = br.readLine();
                while (next != null && next.trim().isEmpty()) {
                    next = br.readLine();
                }
                if (next == null) {
                    return true;
                }
                st = new StringTokenizer(next);
                return st.hasMoreTokens();
            } catch (Exception e) {
                throw new RuntimeException();
            }
        }
    }
}


import java.util.Arrays;
import java.util.Scanner;

public class Main {

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

        private void start() {
                Scanner in = new Scanner(System.in);

                int n = in.nextInt();
                int k = in.nextInt();

                char s[] = in.next().toCharArray();

                if (k == 0) {
                	System.out.println(s.toString());
                	return;
                }

                int last = 1;
                while (true) {
                        boolean find = false;
                        for (int i = last; i < n; i++) {
                                if (s[i - 1] == '4' && s[i] == '7') {

                                        if ((i & 1) != 0) {//odd
                                                if (i != n - 1 && s[i + 1] == '7') {
                                                        k = k % 2;

                                                        if (k == 1) {
                                                                k = 0;
                                                                s[i] = '4';
                                                        }
                                                } else {
                                                        s[i] = '4';
                                                        last = i + 1;
                                                        k--;
                                                }
                                        } else {//even
                                                if (i > 1 && s[i - 2] == '4') {
                                                        k = k % 2;

                                                        if (k == 1) {
                                                                k = 0;
                                                                s[i - 1] = '7';
                                                        }
                                                } else {
                                                        s[i - 1] = '7';
                                                        last = i + 1;
                                                        k--;
                                                }
                                        }
                                        find = true;
                                        break;
                                }
                        }
                        if (!find || k <= 0) {
                                break;
                        }
                }
                System.out.println(new String(s));
        }

}


import java.util.Arrays;
import java.util.Scanner;

public class Main {

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

        private void start() {
                Scanner in = new Scanner(System.in);

                int n = in.nextInt();
                int k = in.nextInt();

                char s[] = in.next().toCharArray();

                if (k == 0) {
                	System.out.println(new String(s));
                	return;
                }

                int last = 1;
                while (true) {
                        boolean find = false;
                        for (int i = last; i < n; i++) {
                                if (s[i - 1] == '4' && s[i] == '7') {

                                        if ((i & 1) != 0) {//odd
                                                if (i != n - 1 && s[i + 1] == '7') {
                                                        k = k % 2;

                                                        if (k == 1) {
                                                                k = 0;
                                                                s[i] = '4';
                                                        }
                                                } else {
                                                        s[i] = '4';
                                                        last = i + 1;
                                                        k--;
                                                }
                                        } else {//even
                                                if (i > 1 && s[i - 2] == '4') {
                                                        k = k % 2;

                                                        if (k == 1) {
                                                                k = 0;
                                                                s[i - 1] = '7';
                                                        }
                                                } else {
                                                        s[i - 1] = '7';
                                                        last = i + 1;
                                                        k--;
                                                }
                                        }
                                        find = true;
                                        break;
                                }
                        }
                        if (!find || k <= 0) {
                                break;
                        }
                }
                System.out.println(new String(s));
        }

}


import java.util.Arrays;
import java.util.Scanner;

public class Main {

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

	private void start() {
		Scanner in = new Scanner(System.in);

		int n = in.nextInt();
		int k = in.nextInt();

		char s[] = in.next().toCharArray();

		int last = 1;
		while (true) {
			boolean find = false;
			for (int i = last; i < n; i++) {
				if (s[i - 1] == '4' && s[i] == '7') {

					if ((i & 1) != 0) {//odd
						if (i != n - 1 && s[i + 1] == '7') {
							k = k % 2;

							if (k == 1) {
								k = 0;
								s[i] = '4';
							}
						} else {
							s[i] = '4';
							last = i + 1;
							k--;
						}
					} else {//even
						if (i > 1 && s[i - 2] == '4') {
							k = k % 2;

							if (k == 1) {
								k = 0;
								s[i - 1] = '7';
							}
						} else {
							s[i - 1] = '7';
							last = i + 1;
							k--;
						}
					}
					find = true;
					break;
				}
			}
			if (!find || k <= 0) {
				break;
			}
		}
		System.out.println(new String(s));
	}

}


/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author Saransh
 */
import java.io.*;
import java.util.*;
import java.math.*;
import java.lang.*;

public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        try
        {
            Parserdoubt pd=new Parserdoubt(System.in);
            int n=pd.nextInt();
            int k=pd.nextInt();
            char arr[]=pd.nextString().toCharArray();
            int count=0;
            for(int i=0;i<arr.length-1&&count<k;i++)
            {
                    if(arr[i]=='4'&&arr[i+1]=='7')
                    {

                        if(i%2==0)
                        {
                            arr[i]='4';
                            arr[i+1]='4';
                            count++;
                        }
                        else
                        {
                            if(arr[i-1]=='4')
                            {

                                if((k-count)%2==1)
                                {
                                    arr[i]='7';
                                }
                                count=k;

                            }
                            else
                            {
                                arr[i]='7';
                                arr[i+1]='7';
                                count++;
                            }
                        }
                    }
             }
             for(int i=0;i<arr.length;i++)
                 System.out.print(arr[i]);

        }
        catch(Exception e)
        {}

    }

}

class Parserdoubt
    {
       final private int BUFFER_SIZE = 1 << 17;

       private DataInputStream din;
       private byte[] buffer;
       private int bufferPointer, bytesRead;

       public Parserdoubt(InputStream in)
       {
          din = new DataInputStream(in);
          buffer = new byte[BUFFER_SIZE];
          bufferPointer = bytesRead = 0;
       }
       public String nextString() throws Exception
       {
           StringBuffer sb=new StringBuffer("");
           byte c = read();
           while (c <= ' ') c = read();
           do
           {
               sb.append((char)c);
               c=read();
           }while(c>' ');
           return sb.toString();
       }
       public char nextChar() throws Exception
       {
           byte c=read();
           while(c<=' ') c= read();
           return (char)c;
       }
       public int nextInt() throws Exception
       {
          int ret = 0;
          byte c = read();
          while (c <= ' ') c = read();
          boolean neg = c == '-';
          if (neg) c = read();
          do
          {
              ret = ret * 10 + c - '0';
             c = read();
          } while (c > ' ');
          if (neg) return -ret;
          return ret;
       }
       public long nextLong() throws Exception
       {
          long ret = 0;
          byte c = read();
          while (c <= ' ') c = read();
          boolean neg = c == '-';
          if (neg) c = read();
          do
          {
              ret = ret * 10 + c - '0';
             c = read();
          } while (c > ' ');
          if (neg) return -ret;
          return ret;
       }
       private void fillBuffer() throws Exception
       {
          bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
          if (bytesRead == -1) buffer[0] = -1;
       }

       private byte read() throws Exception
       {
          if (bufferPointer == bytesRead) fillBuffer();
          return buffer[bufferPointer++];
       }
    }


import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.StringTokenizer;

public class LuckyTranform {
	static StringTokenizer st = null;
    static BufferedReader reader = null;
	public static void main(String[] args) throws NumberFormatException, IOException {
		reader = new BufferedReader(new InputStreamReader(System.in));
//		reader = new BufferedReader(new FileReader("input.txt"));
		int n = NextInt();
		int op = NextInt();
		char ch[] = new char[n];
		ch = NextToken().toCharArray();
		System.err.println(Arrays.toString(ch));
		int a[] = new int[n];
		for (int i = 0; i < n; ++i)
			a[i] = ch[i] - '0';
		int s = 0;
		while(s < n && op > 0) {
			System.err.println(Arrays.toString(a));
			boolean found = false;
			int X = -1;
			for (int x = s; x + 1 < n; ++x) {
				if (a[x] == 4 && a[x + 1] == 7) {
					found = true;
					X = x;
					break;
				}
			}
			if (X == -1)
				break;
			int x = X;
			if ((x & 1) == 1) {
				if (x > 0 && a[x - 1] == 4) {
					if (op % 2 == 1){
						a[x] = 7;
					}
					op = 0;
				} else {
					a[x] = 7;
					--op;
					s = x + 1;
				}
			} else {
				if (x + 2 < n && a[x + 2] == 7) {
					if (op % 2 == 1)
						a[x + 1] = 4;
					op = 0;
				} else {
					--op;
					a[x + 1] = 4;
					s = x + 1;
				}

			}
		}
		System.err.println(Arrays.toString(a));
		for (int i = 0; i < n; ++i)
			System.out.printf("%d", a[i]);
	}
	static String NextToken() throws IOException {
		while(st == null || !st.hasMoreTokens())
			st = new StringTokenizer(reader.readLine());
		return st.nextToken();
	}
	static int NextInt() throws NumberFormatException, IOException {
		return Integer.parseInt(NextToken());
	}
}


import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.StringTokenizer;

public class LuckyTranform {
	static StringTokenizer st = null;
    static BufferedReader reader = null;
	public static void main(String[] args) throws NumberFormatException, IOException {
		reader = new BufferedReader(new InputStreamReader(System.in));
		//reader = new BufferedReader(new FileReader("input.txt"));
		int n = NextInt();
		int op = NextInt();
		char ch[] = new char[n];
		ch = NextToken().toCharArray();
		System.err.println(Arrays.toString(ch));
		int a[] = new int[n];
		for (int i = 0; i < n; ++i)
			a[i] = ch[i] - '0';
		int s = 0;
		while(s < n && op > 0) {
			//System.err.println(Arrays.toString(a));
			boolean found = false;
			int X = -1;
			for (int x = s; x + 1 < n; ++x) {
				if (a[x] == 4 && a[x + 1] == 7) {
					found = true;
					X = x;
					break;
				}
			}
			if (X == -1)
				break;
			int x = X;
			if ((x & 1) == 1) {
				if (x > 0 && a[x - 1] == 4) {
					if (op % 2 == 1){
						a[x] = 7;
					}
					op = 0;
				} else {
					a[x] = 7;
					--op;
					s = x + 1;
				}
			} else {
				if (x + 2 < n && a[x + 2] == 7) {
					if (op % 2 == 1)
						a[x + 1] = 4;
					op = 0;
				} else {
					--op;
					a[x + 1] = 4;
					s = x + 1;
				}

			}
			s = x + 1;
		}
		System.err.println(Arrays.toString(a));
		for (int i = 0; i < n; ++i)
			System.out.printf("%d", a[i]);
	}
	static String NextToken() throws IOException {
		while(st == null || !st.hasMoreTokens())
			st = new StringTokenizer(reader.readLine());
		return st.nextToken();
	}
	static int NextInt() throws NumberFormatException, IOException {
		return Integer.parseInt(NextToken());
	}
}


import java.util.Scanner;

public class test {
    public static void main(String[] args) {
	Scanner in = new Scanner(System.in);
	int n = in.nextInt();
	long k = in.nextLong();
	char[] arr = in.next().toCharArray();
	for (int i = 0; i < arr.length - 1 && k > 0; i++) {
	    if (arr[i] == '4') {
		if ((i + 1) % 2 == 1) {
		    if (i + 2 < arr.length) {
			if (arr[i + 1] == '4' && arr[i + 2] == '7') {
			    if (k % 2 == 1)
				arr[i + 1] = '7';

			    break;
			}

			if (arr[i + 1] == '7' && arr[i + 2] == '7') {
			    if (k % 2 == 1)
				arr[i + 1] = '4';

			    break;
			}
		    }

		    if (arr[i + 1] == '7') {
			arr[i + 1] = '4';
			i += 1;
			k--;
		    }
		} else {
		    if (arr[i + 1] == '7') {
			arr[i] = '7';
			i += 1;
			k--;
		    }
		}
	    }
	}

	System.out.println(arr);

    }
}


import java.util.Scanner;

public class test {
    public static void main(String[] args) {
	Scanner in = new Scanner(System.in);
	int n = in.nextInt();
	long k = in.nextLong();
	char[] arr = in.next().toCharArray();
	for (int i = 0; i < arr.length - 1; i++) {
	    if (arr[i] == '4') {
		if ((i + 1) % 2 == 1) {
		    if (i + 2 < arr.length) {
			if (arr[i + 1] == '4' && arr[i + 2] == '7') {
			    if (k % 2 == 1)
				arr[i + 1] = '7';

			    break;
			}

			if (arr[i + 1] == '7' && arr[i + 2] == '7') {
			    if (k % 2 == 1)
				arr[i + 1] = '4';

			    break;
			}
		    }

		    if (arr[i + 1] == '7') {
			arr[i + 1] = '4';
			i += 1;
			k--;
		    }
		} else {
		    if (arr[i + 1] == '7') {
			arr[i] = '7';
			i += 1;
			k--;
		    }
		}
	    }
	}

	System.out.println(arr);

    }
}


import java.util.*;
import java.io.*;
public class B121 {
    public static void main(String[] args) throws IOException {
        Scanner s = new Scanner(System.in);
        PrintStream out = System.out;
        int n = s.nextInt(), k = s.nextInt();
        String str = s.next();
        char[] d = str.toCharArray();
        PriorityQueue<Integer> tree = new PriorityQueue<Integer>();
        for (int i = 1; i < n; i++) {
            if (d[i-1]=='4' && d[i] == '7') {
                tree.add(i);
            }
        }
        //System.out.println(tree);
        int iter = 0;
        int[] lastSeen = new int[n];
        while (!tree.isEmpty() && iter < k) {
            iter++;
            int min = tree.poll();
            if (lastSeen[min] > 0 && lastSeen[min] % 2 != k % 2) {
                break;
            }
            lastSeen[min] = iter;
            if (min % 2 == 0) {
                d[min-1] = '7';
                if (min-2 >= 0 && d[min-2]=='4') {
                    tree.add(min-1);
                }
            } else {
                d[min] = '4';
                if (min+1 < n && d[min+1]=='7') {
                    tree.add(min+1);
                }
            }
            //System.out.println(tree);
            //System.out.println(new String(d));
        }
        System.out.println(new String(d));
    }
}


import java.util.*;

public class Main {

  public static void main(String args[]) {
    (new Main()).solve();
  }

  String solve(int n, int k, String s) {

    StringBuilder str = new StringBuilder(s);

    int prev = 0;

  MAIN:
    while( k > 0 ) {

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

        if( str.charAt(i) == '4' && str.charAt(i + 1) == '7' ) {
          --k;
          // 0 origin ...;
          if( i % 2 == 0 ) {
            str.setCharAt(i + 1, '4');
            if( i + 2 < n && str.charAt(i + 2) == '7' ) { k -= (k / 2) * 2; }
            prev = i;
          }
          else {
            str.setCharAt(i, '7');
            if( i > 0 && str.charAt(i - 1) == '4' ) { k -= (k / 2) * 2; }
            prev = i - 1;
          }
          continue MAIN;
        }

      }

      break;

    }

    return str.toString();

  }

  void solve() {

    Scanner cin = new Scanner(System.in);

    while( cin.hasNextInt() ) {

      int n = cin.nextInt();
      int k = cin.nextInt();

      String s = cin.next();

      System.out.println(solve(n, k, s));

    }

  }

}


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

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

	void solve()
	{
		int n = ni(), k = ni();
		char[] s = ns(n);
		for(int i = 0;i < n-1 && k > 0;i++){
			if(s[i] == '4' && s[i+1] == '7'){
				if(i % 2 == 0){
					s[i+1] = '4';
					k--;
				}else{
					s[i] = '7';
					k--;
					if(i-1 >= 0 && s[i-1] == '4'){
						k %= 2;
						i = -1;
					}
				}
			}
		}
		out.println(new String(s));
	}

	void run() throws Exception
	{
		is = oj ? System.in : new ByteArrayInputStream(INPUT.getBytes());
		out = new PrintWriter(System.out);

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

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

	public int ni()
	{
		try {
			int num = 0;
			boolean minus = false;
			while((num = is.read()) != -1 && !((num >= '0' && num <= '9') || num == '-'));
			if(num == '-'){
				num = 0;
				minus = true;
			}else{
				num -= '0';
			}

			while(true){
				int b = is.read();
				if(b >= '0' && b <= '9'){
					num = num * 10 + (b - '0');
				}else{
					return minus ? -num : num;
				}
			}
		} catch (IOException e) {
		}
		return -1;
	}

	public long nl()
	{
		try {
			long num = 0;
			boolean minus = false;
			while((num = is.read()) != -1 && !((num >= '0' && num <= '9') || num == '-'));
			if(num == '-'){
				num = 0;
				minus = true;
			}else{
				num -= '0';
			}

			while(true){
				int b = is.read();
				if(b >= '0' && b <= '9'){
					num = num * 10 + (b - '0');
				}else{
					return minus ? -num : num;
				}
			}
		} catch (IOException e) {
		}
		return -1;
	}

	public String ns()
	{
		try{
			int b = 0;
			StringBuilder sb = new StringBuilder();
			while((b = is.read()) != -1 && (b == '\r' || b == '\n' || b == ' '));
			if(b == -1)return "";
			sb.append((char)b);
			while(true){
				b = is.read();
				if(b == -1)return sb.toString();
				if(b == '\r' || b == '\n' || b == ' ')return sb.toString();
				sb.append((char)b);
			}
		} catch (IOException e) {
		}
		return "";
	}

	public char[] ns(int n)
	{
		char[] buf = new char[n];
		try{
			int b = 0, p = 0;
			while((b = is.read()) != -1 && (b == ' ' || b == '\r' || b == '\n'));
			if(b == -1)return null;
			buf[p++] = (char)b;
			while(p < n){
				b = is.read();
				if(b == -1 || b == ' ' || b == '\r' || b == '\n')break;
				buf[p++] = (char)b;
			}
			return Arrays.copyOf(buf, p);
		} catch (IOException e) {
		}
		return null;
	}

	double nd() { return Double.parseDouble(ns()); }
	boolean oj = System.getProperty("ONLINE_JUDGE") != null;
	void tr(Object... o) { if(!oj)System.out.println(Arrays.deepToString(o)); }
}


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

public class Q121B implements Runnable {
    private void solve() throws IOException {
        int n = nextInt();
        int k = nextInt();
        char[] number = nextToken().toCharArray();
        int current4 = 0;
        for (int i = 0; i < k; i++) {
            while ((current4 < n - 1 ) && !(number[current4] == '4' && number[current4 + 1] == '7')) {
                current4++;
            }
            if (current4 == n - 1) {
                out(number);
                return;
            }
            if (current4 % 2 == 0) number[current4 + 1] = '4';
            else {
                number[current4] = '7';
                number[current4 + 1] = '7';
            }
            current4--;
            if(current4<0)current4=0;
        }
        out(number);
    }

    private void out(char[] number) {
        writer.print(number);
    }

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

    BufferedReader reader;
    StringTokenizer tokenizer;
    PrintWriter writer;

    public void run() {
        try {

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

            reader = oj ? new BufferedReader(new InputStreamReader(System.in)) :
                    new BufferedReader(new FileReader(new File("input.txt")));

            tokenizer = null;
            writer = new PrintWriter(System.out);
            solve();
            reader.close();
            writer.close();
        } catch (Exception e) {
            e.printStackTrace();
            System.exit(1);
        }
    }

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

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

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

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


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

public class Q121B implements Runnable {
    private void solve() throws IOException {
        int n = nextInt();
        int k = nextInt();
        char[] number = nextToken().toCharArray();
        int current4 = 0;
        for (int i = 0; i < k; i++) {
            while ((current4 < n - 1 ) && !(number[current4] == '4' && number[current4 + 1] == '7')) {
                current4++;
            }
            if (current4 == n - 1) {
                out(number);
                return;
            }
            if (current4 % 2 == 0) number[current4 + 1] = '4';
            else {
                number[current4] = '7';
                number[current4 + 1] = '7';
                if(current4!=0 && number[current4-1]=='4'){
                    if((k-i)%2==1){

                    }else{
                        number[current4]='4';
                    }
                    out(number);
                    return;
                }
            }
        }
        out(number);
    }

    private void out(char[] number) {
        writer.print(number);
    }

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

    BufferedReader reader;
    StringTokenizer tokenizer;
    PrintWriter writer;

    public void run() {
        try {

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

            reader = oj ? new BufferedReader(new InputStreamReader(System.in)) :
                    new BufferedReader(new FileReader(new File("input.txt")));

            tokenizer = null;
            writer = new PrintWriter(System.out);
            solve();
            reader.close();
            writer.close();
        } catch (Exception e) {
            e.printStackTrace();
            System.exit(1);
        }
    }

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

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

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

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


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

public class Q121B implements Runnable {
    private void solve() throws IOException {
        int n = nextInt();
        int k = nextInt();
        char[] number = nextToken().toCharArray();
        int current4 = 0;
        for (int i = 0; i < k; i++) {
            while ((current4 < n - 1 ) && !(number[current4] == '4' && number[current4 + 1] == '7')) {
                current4++;
            }
            if (current4 == n - 1) {
                out(number);
                return;
            }
            if (current4 % 2 == 0) number[current4 + 1] = '4';
            else {
                number[current4] = '7';
                number[current4 + 1] = '7';
                if(current4!=0)current4--;
            }
        }
        out(number);
    }

    private void out(char[] number) {
        writer.print(number);
    }

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

    BufferedReader reader;
    StringTokenizer tokenizer;
    PrintWriter writer;

    public void run() {
        try {

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

            reader = oj ? new BufferedReader(new InputStreamReader(System.in)) :
                    new BufferedReader(new FileReader(new File("input.txt")));

            tokenizer = null;
            writer = new PrintWriter(System.out);
            solve();
            reader.close();
            writer.close();
        } catch (Exception e) {
            e.printStackTrace();
            System.exit(1);
        }
    }

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

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

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

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


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

public class CodeForces {

    private boolean isLucky(long n) {
        if(n == 0) return false;
        while(n > 0) {
            long u = n % 10;
            if(u != 4 && u != 7) return false;
            n /= 10;
        }
        return true;
    }

    private void solve() throws IOException {
        int n = nextInt(), k = nextInt();
        int []a = new int[n];
        String line = nextLine();
        for(int i = 0; i < n; i++)
            a[i] = line.charAt(i) - '0';

        int x;
        for(x = 1; x < n; x++) if(a[x-1] == 4 && a[x] == 7) break;
        if(x < n) {
            while(k > 0 && x != -1) {
                int y = x;

                if(x % 2 == 0) {
                    if(x - 2 >= 0 && a[x-2] == 4) {
                        if(k % 2 != 0)
                            a[x-1] = a[x] = 7;
                        break;
                    } else y = -1;
                    a[x-1] = a[x] = 7;
                } else {
                    if(x + 1 < n && a[x+1] == 7) {
                        if(k % 2 != 0)
                            a[x-1] = a[x] = 4;
                        break;
                    } else y = -1;
                    a[x-1] = a[x] = 4;
                }
                k--;
                if(y == -1) {
                    for(; x < n; x++) if(a[x-1] == 4 && a[x] == 7) break;
                    if(x >= n) break;
                }
            }
        }
        for(int i = 0; i < n; i++)
            System.out.print(a[i]);
    }

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

    BufferedReader reader;
    StringTokenizer tokenizer;
    PrintWriter writer;

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

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

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

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

    String nextLine() throws IOException {
        return reader.readLine();
    }

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