We have a sequence of N \times K integers: X=(X_0,X_1,\cdots,X_{N \times K-1}). Its elements are represented by another sequence of N integers: A=(A_0,A_1,\cdots,A_{N-1}). For each pair i, j (0 \leq i \leq K-1,\ 0 \leq j \leq N-1), X_{i \times N + j}=A_j holds.

Snuke has an integer sequence s, which is initially empty. For each i=0,1,2,\cdots,N \times K-1, in this order, he will perform the following operation:

* If s does not contain X_i: add X_i to the end of s.
* If s does contain X_i: repeatedly delete the element at the end of s until s no longer contains X_i. Note that, in this case, we do not add X_i to the end of s.



Find the elements of s after Snuke finished the operations.

Constraints

* 1 \leq N \leq 2 \times 10^5
* 1 \leq K \leq 10^{12}
* 1 \leq A_i \leq 2 \times 10^5
* All values in input are integers.

Input

Input is given from Standard Input in the following format:


N K
A_0 A_1 \cdots A_{N-1}


Output

Print the elements of s after Snuke finished the operations, in order from beginning to end, with spaces in between.

Examples

Input

3 2
1 2 3


Output

2 3


Input

5 10
1 2 3 2 3


Output

3


Input

6 1000000000000
1 1 2 2 3 3


Output




Input

11 97
3 1 4 1 5 9 2 6 5 3 5


Output

9 2 6
import java.util.*;
import java.io.*;

class Main{
    public static void main(String[] args) throws Exception{
        FastScanner fsc=new FastScanner();
        int n=fsc.nextInt();
        long k=fsc.nextLong()*n-1;
        int[] a=new int[n];
        HashMap<Integer, ArrayList<Integer>> map=new HashMap<>();
        for(int i=0;i<n;i++){
            a[i]=fsc.nextInt();
            if(!map.containsKey(a[i])){
                map.put(a[i], new ArrayList<>());
            }
            map.get(a[i]).add(i);
        }
        fsc.close();
        int[] next=new int[n];
        int[] len=new int[n];
        for(int i=0;i<n;i++){
            List<Integer> list=map.get(a[i]);
            int l=0, r=list.size();
            while(r-l>1){
                int m=l+(r-l)/2;
                if(list.get(m)<=i) l=m;
                else r=m;
            }
            next[i]=list.get((l+1)%list.size());
            if(i<next[i]){
                len[i]=next[i]-i;
            } else{
                len[i]=next[i]-i+n;
            }
        }
        // System.out.println("next:");
        // for(int i=0;i<n;i++){
        //     System.out.print(i+": "+next[i]+", ");
        // }
        // System.out.println();
        // System.out.println("len:");
        // for(int i=0;i<n;i++){
        //     System.out.print(i+": "+len[i]+", ");
        // }
        // System.out.println();
        int begin=-1, end=-1;
        long loop=-1;
        int now=0;
        boolean[] visit=new boolean[n];
        visit[now]=true;
        long d=0;
        long sub=0;
        while(true){
            int nxt=next[now];
            d+=len[now];
            now=(nxt+1)%n;
            if(!visit[now]){
                d++;
                visit[now]=true;
            } else{
                begin=now;
                end=nxt;
                int nw=0;
                while(true){
                    if(nw==now){
                        break;
                    }
                    int nx=next[nw];
                    sub+=len[nw];
                    nw=(nx+1)%n;
                    sub++;
                }
                loop=d-sub+1;
                break;
            }
        }
        if(n==1){
            System.out.println(a[0]);
            return;
        }
        // System.out.println("begin: "+begin);
        // System.out.println("end: "+end);
        // System.out.println("sub: "+sub);
        // System.out.println("loop: "+loop);
        // System.exit(0);
        int nw;
        if(k<sub){
            nw=0;
        } else{
            k-=sub;
            k%=loop;
            nw=begin;
        }
        ArrayList<Integer> ans=new ArrayList<>();
        while(true){
            //System.out.println("now: "+nw+" , k: "+k);
            if(k>=len[nw]){
                k-=len[nw];
                if(k==0){
                    break;
                }
                nw=(next[nw]+1)%n;
                k--;
                if(k==0){
                    ans.add(a[nw]);
                    break;
                }
            } else{
                ans.add(a[nw]);
                nw=(nw+1)%n;
                k--;
                if(k==0){
                    ans.add(a[nw]);
                    break;
                }
            }
        }
        StringBuilder sb=new StringBuilder();
        for(int s:ans){
            sb.append(s).append(" ");
        }
        System.out.println(sb);
    }
    

    static class FastScanner {
        private final InputStream in = System.in;
        private final byte[] buffer = new byte[1024];
        private int ptr = 0;
        private int buflen = 0;
        private boolean hasNextByte(){
            if(ptr<buflen) return true;
            else{
                ptr = 0;
                try{
                    buflen = in.read(buffer);
                }
                catch(IOException e){
                    e.printStackTrace();
                }
                if(buflen<=0) return false;
            }
        return true;
        }
        private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}
        private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}
        public boolean hasNext() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++; return hasNextByte();}
        public String next() {
            if (!hasNext()) throw new NoSuchElementException();
            StringBuilder sb = new StringBuilder();
            int b = readByte();
            while(isPrintableChar(b)) {
                sb.appendCodePoint(b);
                b = readByte();
            }
            return sb.toString();
        }
        public long nextLong() {
            if (!hasNext()) throw new NoSuchElementException();
            long n = 0;
            boolean minus = false;
            int b = readByte();
            if (b == '-') {
                minus = true;
                b = readByte();
            }
            if (b < '0' || '9' < b) throw new NumberFormatException();
            while(true){
                if ('0' <= b && b <= '9') {
                    n *= 10;
                    n += b - '0';
                }
                else if(b == -1 || !isPrintableChar(b)) return minus ? -n : n;
                else throw new NumberFormatException();
                b = readByte();
            }
        }
        public int nextInt() {
            long nl = nextLong();
            if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();
            return (int) nl;
        }
        public double nextDouble() { return Double.parseDouble(next());}
        public void close(){
            try{in.close();}
            catch(IOException e){e.printStackTrace();}
        }
    }
}
