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
def examA():
    N = DI()/dec(7)
    ans = N
    print(N)
    return

def examB():
    N, K = LI()
    A = LI()
    maxA = max(A)

    def function(s):
        stack = deque()
        num = [0]*(maxA+1)
        for i in range(s,N):
            a = A[i]
            if num[a]==0:
                stack.append(a)
                num[a] += 1
            else:
                while(num[a]>0):
                    num[stack.pop()] -= 1

        return stack

    B = [-1 for _ in range(N)]
    que = {}
    for i in range(N):
        a = A[i]
        if a not in que:
            que[a] = i
        else:
            prev = que.pop(a)
            B[prev] = i - prev
            que[a] = i
    i = 0
    while(que):
        a = A[i]
        if a in que:
            prev = que.pop(a)
            B[prev] = N + i - prev
        i += 1
    #print(B)
    locat_doubling = [[-1]*N for _ in range(51)]

    for i in range(N):
        locat_doubling[0][i] = 0
        locat_doubling[1][i] = B[i] + 1

    for k in range(2,51):
        for i in range(N):
            locat_doubling[k][i] = locat_doubling[k-1][i] + locat_doubling[k-1][(i+locat_doubling[k-1][i])%N]
            if locat_doubling[k][i]>inf:
                locat_doubling[k][i] = inf
    #print(locat_doubling[:5])
    now = 0
    rest = K*N
    for i in range(51)[::-1]:
        if locat_doubling[i][now]<=rest:
            rest -= locat_doubling[i][now]
            now = (locat_doubling[i][now]+now)%N
    #print(rest,now)

    ans = function(now)
    print(" ".join(map(str,ans)))
    return

def examC():
    ans = 0
    print(ans)
    return

def examD():
    ans = 0
    print(ans)
    return

def examE():
    ans = 0
    print(ans)
    return

def examF():
    ans = 0
    print(ans)
    return

from decimal import getcontext,Decimal as dec
import sys,bisect,itertools,heapq,math,random
from copy import deepcopy
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
def I(): return int(input())
def LI(): return list(map(int,sys.stdin.readline().split()))
def DI(): return dec(input())
def LDI(): return list(map(dec,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
global mod,mod2,inf,alphabet,_ep
mod = 10**9 + 7
mod2 = 998244353
inf = 10**18
_ep = dec("0.000000000001")
alphabet = [chr(ord('a') + i) for i in range(26)]
alphabet_convert = {chr(ord('a') + i): i for i in range(26)}

getcontext().prec = 28

sys.setrecursionlimit(10**7)

if __name__ == '__main__':
    examB()

"""
142
12 9 1445 0 1
asd dfg hj o o
aidn
"""