<image>

William really likes the cellular automaton called "Game of Life" so he decided to make his own version. For simplicity, William decided to define his cellular automaton on an array containing n cells, with each cell either being alive or dead.

Evolution of the array in William's cellular automaton occurs iteratively in the following way:

  * If the element is dead and it has exactly 1 alive neighbor in the current state of the array, then on the next iteration it will become alive. For an element at index i the neighbors would be elements with indices i - 1 and i + 1. If there is no element at that index, it is considered to be a dead neighbor. 
  * William is a humane person so all alive elements stay alive. 



Check the note section for examples of the evolution.

You are given some initial state of all elements and you need to help William find the state of the array after m iterations of evolution.

Input

Each test contains multiple test cases. The first line contains the number of test cases t (1 ≤ t ≤ 10^3). Description of the test cases follows.

The first line of each test case contains two integers n and m (2 ≤ n ≤ 10^3, 1 ≤ m ≤ 10^9), which are the total number of cells in the array and the number of iterations.

The second line of each test case contains a string of length n made up of characters "0" and "1" and defines the initial state of the array. "1" means a cell is alive and "0" means it is dead.

It is guaranteed that the sum of n over all test cases does not exceed 10^4.

Output

In each test case output a string of length n, made up of characters "0" and "1" — the state of the array after m iterations of evolution.

Example

Input


4
11 3
01000000001
10 2
0110100101
5 2
10101
3 100
000


Output


11111001111
1110111101
10101
000

Note

Sequence of iterations of evolution for the first test case 

  * 01000000001 — initial state 
  * 11100000011 — first iteration of evolution 
  * 11110000111 — second iteration of evolution 
  * 11111001111 — third iteration of evolution 



Sequence of iterations of evolution for the second test case 

  * 0110100101 — initial state 
  * 1110111101 — first iteration of evolution 
  * 1110111101 — second iteration of evolution 
import java.io.IOException;
import java.io.InputStream;
import java.util.Arrays;
import java.util.InputMismatchException;

public class Solution {
	static InputReader in = new InputReader(System.in);
	static int mod = (int)1e9 + 7;
	static int MAXN = 100005;
	static long[] fact = new long[MAXN];
	static long[] inv = new long[MAXN];
	static long count = 0;
	
    public static void main(String args[]) {
        new Thread(null, new Runnable() {
            public void run() {
                try{
                    solve();
                }
                catch(Exception e){
                    e.printStackTrace();
                }
            }
        }, "1", 1 << 26).start();
    }
    
    public static void solve(){
    	int T = in.ni();
    	while(T-- > 0) {
    		int n = in.nextInt();
    		int m = in.nextInt();
    		char[] s = in.readString().toCharArray();
//    		int i = 0;
//    		while(i < s.length && s[i] == '0') i++;
//    		if(i != n) {
//	    		int j = i - 1, count = m;
//	    		while(j >= 0 && s[j] == '0' && count > 0) {
//	    			s[j] = '1'; j--; count--;
//	    		}
//	    		
//	    		count = m; j = i;
//	    		i++;
//	    		while(i < n) {
//	    			pn(i+" "+j);
//	    			if(s[i] == '0') {
//	    				i++;
//	    			}
//	    			else {
//	    				int l = j + 1, r = i - 1;
//
//	    				while(l < r && count > 0) {
//	    					s[l] = s[r] = '1';
//	    					l++; r--;
//	    					count--;
//	    				}
//	    				count = m;
//	    				i++;
//	    				j = i;
//	    			}
//	    		}
//	    		
//				int l = j + 1, r = i - 1;
//	    		while(l < r && m-- > 0) {
//					s[l] = s[r] = '1';
//					l++; r--;
//				}
//    		}
    		char[] arr = new char[n];
    		for(int i = 0; i < n; i++) {
    			if(s[i]=='1'){
    	            arr[i] = 0;
    	        }
    	        else{
    	            arr[i]++;
    	            if(i != 0){
    	                arr[i]+=arr[i-1];
    	            }
    	        }
    		}
    		
    		int pos=n;
    		for(int i = 0; i < n; i++){
    		        if(s[i]=='1'){
    		            pos=i;
    		            break;
    		        }
    		    }
    		    for(int i = pos; i < n - 1; i++){
    		        if(arr[i] > 0 && arr[i + 1]==0){
    		            int start=i-arr[i]+1;
    		            int x=arr[i]/2;
    		            x = Math.min(x,m);
    		            for(int j = start; j < start + x; j++){
    		                s[j]='1';
    		            }
    		            for(int j = i; j > i - x; j--){
    		                s[j]='1';
    		            }
    		        }
    		    }
    		    if(pos<n){
    		        int cnt=m;
    		        for(int i=pos-1;i>=0 && cnt-- > 0; i--){
    		            s[i]='1';
    		        }
    		    }
    		    
    		    if(arr[n-1]>0 && arr[n-1]<n){
    		        int start=n-1-arr[n-1]+1;
    		        for(int j=start;j<start+m && j<n;j++){
    		            s[j]='1';
    		        }
    		    }
    		
    		StringBuilder sb = new StringBuilder(n);
    		for(int i = 0; i < n; i++) {
    			sb.append(s[i]);
    		}
    		System.out.println(sb.toString());
    	}
    }
    
    private static String reverse(String s) {
    	char[] curr = new char[s.length()];
    	int x = 0;
    	for(int i = s.length() - 1; i >= 0; i--) curr[i] = s.charAt(x++);
		return String.valueOf(curr);
	}

	public static long count(String s, long n, long k) {
		long count = 0;
    	long x;
    	if(n % 2 == 0) x = n / 2;
    	else x = n/2 + 1;
    	for(int i = 0; i < x; i++) {
    		long t1 = binPow(k, x - i - 1);
    		long less = s.charAt(i) - 97;
    		count = (count + mul(less, t1)) % mod;
    	}
    	if(!palindrome(s) && check(s)) count = (count + 1) % mod;
    	return count;
    }
    
    
   
    private static boolean check(String s) {
    	int n = s.length();
    	char[] curr = new char[s.length()];
    	int x;
    	if(n % 2 == 0) x = n / 2;
    	else x = n/2 + 1;
    	for(int i = 0; i < x; i++) {
    		curr[i] = s.charAt(i);
			curr[n - i - 1] = s.charAt(i);
			
    	}
    	//pn(String.valueOf(curr));
		return String.valueOf(curr).compareTo(s) < 0;
	}

	private static void rec(char[] curr, String s, int k, int i) {
    	int n = s.length();
		if((n%2 == 0 && i == n/2) || (n%2 != 0 && i == n/2 + 1)) {
			if(String.valueOf(curr).compareTo(s) < 0) {
				//pn(String.valueOf(curr));
				count++;
			}
			return;
		}
		for(char ch = 'a'; ch <= 'a' + k - 1; ch++) {
			curr[i] = ch;
			curr[n - i - 1] = ch;
			rec(curr, s, k, i + 1);
		}
	}

	private static boolean palindrome(String s) {    	
    	int l = 0, r = s.length() - 1;
    	while(l < r) {
    		if(s.charAt(l) != s.charAt(r)) return false;
    		l++;
    		r--;
    	}
		return true;
	}

	/*TEMPLATE*/
    
    //MATHS
    static int max(Integer... ar) {
    	int max = Integer.MIN_VALUE;
    	for(int i: ar) {
    		max = Math.max(max, i);
    	}
    	return max;
    }
    
    static long max(Long... ar) {
    	long max = Integer.MIN_VALUE;
    	for(long i: ar) {
    		max = Math.max(max, i);
    	}
    	return max;
    }
  
    static int gcd(int a, int b) {
    	return (b==0)?a:gcd(b,a%b);
    }
    
    static long binPow(long x, long y) {
        long ans = 1L;
        while(y > 0) {
            if(y % 2 == 1)
                ans = mul(ans, x);
            x = mul(x, x);
            y /= 2;
        }
        return ans;
    }
    
    static long add(long x, long y) {
    	x += y;
    	return mod(x, mod);
    }
    
    static long mul(long x, long y) {
    	return mod(x * y, mod);
    }
    
    static long divide(long x, long y) {
        return mul(x, binPow(y, mod - 2));
    }

    static long mod(long x, long p) {
        x %= p;
        if (x < 0)
            x += p;
        return x;
    }
        
    public static int[] spf(int maxn) {
    	int[] spf=new int[maxn+1];
    	spf[0]=spf[1]=1;
    	for(int i=2;i<=maxn;i++) {
    		if(i%2==0) spf[i]=2;
    		else 
    			spf[i]=i;
    	}
    	for(int i=3;i*i<=maxn;i++) {
    		if(spf[i]==i){
    			for (int j=i*i; j<=maxn; j+=i) 
                    if (spf[j]==j) 
                        spf[j] = i;
    		}
    	}
    	return spf;
    }
    
    static void nCrInit() {
    	fact[0] = 1;
    	for(int i = 1; i < MAXN; i++) fact[i] = mul(fact[i - 1], 1L * i);
    	inv[MAXN - 1] = binPow(fact[MAXN - 1], mod - 2); 
    	for(int i = MAXN - 2; i >= 0; i--) inv[i] = mul(inv[i + 1], 1L * (i + 1));
     }
    
    static long nCr(int n, int r) {
    	if(r > n || n < 0 || r < 0) return 0;
    	return fact[n] * inv[r] % mod * inv[n - r] % mod;
    }
    
    //ARRAYS
    public static int[] intArray(int n) {
    	int ar[]=new int[n];
    	for(int i=0;i<n;i++)
    		ar[i]=in.nextInt();
    	return ar;
    }
    
    public static void swap(int i, int j, int ar[]) {
    	int c=ar[i];ar[i]=ar[j];ar[j]=c;
    }
    
    public static void reverse(int ar[]) {
    	int l=0, r=ar.length-1;
    	while(l<r) {
    		int temp=ar[l]; ar[l]=ar[r]; ar[r]=temp;
    		l++; r--;
    	}
    }
    
    public static int upperBound(int[] array, int value) {
    	//return next higher element. If greater than all elements then returns array.length
    	//returns 0 if smaller than all elements
    	int low = 0;
    	int high = array.length;
    	while (low < high) {
    		final int mid = (low + high) / 2;
    		if (value >= array[mid]) {
    			low = mid + 1;
    		} else {
    			high = mid;
    		}
    	}
    	return low;
    }
    
    public static int lowerBound(int[] array, int value) {
    	//Returns first occurrence.
    	//Bigger than all elements then return array.length
    	//Not found, then next greater.s
    	int low = 0;
    	int high = array.length;
    	while (low < high) {
    		final int mid = (low + high) / 2;
			if (value <= array[mid]) {
			high = mid;
			} else {
				low = mid + 1;
			}
    	}
    	return low;
	}
    
    //Segment Tree
    static class SegNode {
    	//SegNode contains all query variables
    	long v;
    	SegNode() {
    		//Initialise using identity values
    		v = 0;
    	}
    	
    	SegNode(long v) {
    		this.v = v;
    	}
    	
    	public void merge(SegNode l, SegNode r) {
    		this.v = l.v + r.v;
    	}
    }
    
    static class SegUpdate {
    	//It contains only the updates not the query variables.
    	long v; 
    	SegUpdate() {
    		//Initialise all segupdate variables here with identity values
    		// 0 for sum
    		//Integer.MAX_VALUE for min operations
    		// 1 for product, etc.
    		this.v = 0;
    	}
    	
    	SegUpdate(long v) {
    		this.v = v;
    	}
    	
    	//Combine current update with other update.
    	//Other update is newer than my present update
    	//In case of non-lazy propagation leave this blank
    	public void combine(SegUpdate other, int tl, int tr) {
    		v += other.v;
    	}
    	
    	//Apply all updates so far in the query variables inside SegNode
    	//In case of non-lazy updates, consider x to be a leaf node.
    	public void apply(SegNode x, int tl, int tr) {
    		x.v += (tr - tl + 1) * v;
    	}
    }
    
    static class SegTree {
    	int len;
    	SegNode[] t;
    	SegUpdate[] u;
    	boolean[] lazy;
    	
    	SegTree(int l) {
    		len = l;
    		t = new SegNode[4 * len];
    		for(int i = 0; i < t.length; i++) t[i] = new SegNode();
    		u = new SegUpdate[4 * len];
    		for(int i = 0; i < u.length; i++) u[i] = new SegUpdate();    		
    		lazy = new boolean[4 * len];
    	}
    	
    	int descent(int k) {
    		return descent(1, 0, len - 1, k);
    	}
    	
    	int descent(int v, int tl, int tr, int k) {
    		if(t[v].v < k) {
    			return -1;
    		} 
    		while(tl < tr) {
    			int tm = (tl + tr)/2;
    			if(t[2*v].v >= k) {
    				tr = tm;
    				v = 2*v;
    			} else {
    				tl = tm + 1;
    				k -= t[2*v].v;
    				v = 2*v + 1;
    			}
    		}
			return tl;
    	}
     
    	void pushdown(int v, int tl, int tr){
    		if(!lazy[v]) return;
    		int tm = (tl + tr) >> 1;
    		apply(v<<1, tl, tm, u[v]);
    		apply(v<<1|1, tm + 1, tr, u[v]);
    		u[v] = new SegUpdate();
    		lazy[v] = false;
    	}
     
    	void apply(int v, int tl, int tr, SegUpdate upd){
    		if(tl != tr){
    			lazy[v] = true;
    			u[v].combine(upd, tl, tr);
    		}
    		upd.apply(t[v], tl, tr);
    	}
    	
    	private void build(int[] arr, int v, int tl, int tr){
    		if(tl == tr){
    			t[v] = new SegNode(arr[tl]);
    			return;
    		}
    		int tm = (tl + tr) >> 1;
    		build(arr, v<<1, tl, tm);
    		build(arr, v<<1|1, tm + 1, tr);
    		t[v].merge(t[v<<1], t[v<<1|1]);
    	}
     
    	private SegNode query(int v, int tl, int tr, int l, int r){
    		if(l > tr || r < tl){
    			return new SegNode();
    		}
    		if(tl >= l && tr <= r){
    			return t[v];
    		}
    		pushdown(v, tl, tr);
    		int tm = (tl + tr) >> 1;
    		SegNode a = query(v<<1,tl,tm,l,r),b = query(v<<1|1,tm+1,tr,l,r);
    		SegNode ans = new SegNode();
    		ans.merge(a,b);
    		return ans;
    	}
     
    	// rupd = range update
    	private void rupd(int v, int tl, int tr, int l, int r, SegUpdate upd){
    		if(l > tr || r < tl){
    			return;
    		}
    		if(tl >= l && tr <= r){
    			apply(v,tl,tr,upd);
    			return;
    		}
    		pushdown(v,tl,tr);
    		int tm = (tl + tr) >> 1;
    		rupd(v<<1,tl,tm,l,r,upd);
    		rupd(v<<1|1,tm+1,tr,l,r,upd);
    		t[v].merge(t[v<<1], t[v<<1|1]);
    	}
     
    	void build(int[] arr){
    		build(arr, 1, 0, len - 1);
    	}
    	
    	void build(long[] arr){
    		build(arr, 1, 0, len - 1);
    	}
    	
    	private void build(long[] arr, int v, int tl, int tr){
    		if(tl == tr){
    			t[v] = new SegNode(arr[tl]);
    			return;
    		}
    		int tm = (tl + tr) >> 1;
    		build(arr, v<<1, tl, tm);
    		build(arr, v<<1|1, tm + 1, tr);
    		t[v].merge(t[v<<1], t[v<<1|1]);
    	}
    	
    	SegNode query(int l, int r){
    		return query(1,0,len-1,l,r);
    	}
    	
    	void rupd(int l, int r, SegUpdate upd){
    		rupd(1,0,len-1,l,r,upd);
    	}
    	
    	void debug() { 
    		System.out.println("------Debug-----");
    		for(int i = 0; i < 4 * len; i++) {
        		System.out.print(t[i].v+" ");
        	}
    		
    		for(int i = 0; i < 4 * len; i++) {
        		System.out.print(u[i].v+" ");
        	}
    		
        	System.out.println();
        	System.out.println(Arrays.toString(lazy));
        	System.out.println("-------------");
    	}
    }
   
    public static void pn(Object o) {
      System.out.println(o);
    }
    
    static class InputReader {
 
        private InputStream stream;
        private byte[] buf = new byte[8192];
        private int curChar;
        private int snumChars;
        private SpaceCharFilter filter;
 
        public InputReader(InputStream stream) {
            this.stream = stream;
        }
        
        public int ni() {
			return nextInt();
		}
 
        public int snext() {
            if (snumChars == -1)
                throw new InputMismatchException();
            if (curChar >= snumChars) {
                curChar = 0;
                try {
                    snumChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (snumChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }
 
        public int nextInt() {
            int c = snext();
            while (isSpaceChar(c))
                c = snext();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = snext();
            }
 
            int res = 0;
 
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = snext();
            } while (!isSpaceChar(c));
 
            return res * sgn;
        }
 
        public long nextLong() {
            int c = snext();
            while (isSpaceChar(c))
                c = snext();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = snext();
            }
 
            long res = 0;
 
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = snext();
            } while (!isSpaceChar(c));
 
            return res * sgn;
        }
        
        public double nextDouble() {
            int c = snext();
            while (isSpaceChar(c))
                c = snext();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = snext();
            }
 
            double res = 0, div = 1.0;
            
            do {
                res = res * 10 + c - '0';
            } while ((c = snext()) >= '0' && c <= '9');
 
            if (c == '.') {
                while ((c = snext()) >= '0' && c <= '9') {
                    res += (c - '0') / (div *= 10);
                }
            }
            
            return res * sgn;
        }
 
        public String readString() {
            int c = snext();
            while (isSpaceChar(c))
                c = snext();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = snext();
            } while (!isSpaceChar(c));
            return res.toString();
        }
 
        public boolean isSpaceChar(int c) {
            if (filter != null)
                return filter.isSpaceChar(c);
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }
 
        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);
        }
    }
}