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
#!/usr/bin/env python
# coding: utf-8

def ri():
    return int(input())

def rl():
    return list(input().split())

def rli():
    return list(map(int, input().split()))

def main():
    n, k = rli()
    la = rli()
    MOD = len(la)
    lb = [-1 for _ in range(len(la))]
    periods = dict()
    for i, a in enumerate(la):
        periods.setdefault(a, [])
        periods[a].append(i)
    for v in periods.values():
        for i, e in enumerate(v):
            if i == len(v)-1:
                lb[e] = (v[0] + 1) % MOD
            else:
                lb[e] = (v[i+1] + 1) % MOD
    loop = [0]
    b = 0
    while True:
        nb = lb[b]
        if nb == 0:
            break
        if nb-b <= 1:
            loop.append(nb)
        b = nb
    # 周期を計算
    period = len(loop)
    if loop[-1] == len(loop)-1:
        loop.append(None)
        period += 1

    start = loop[(k-1)%period]
    if start is None:
        print()
        return
    lc = la[start:]

    counts = dict()
    for i, a in enumerate(lc):
        counts.setdefault(a, 0)
        counts[a] += 1

    ans = []
    target = None
    for a in lc:
        if target is None:
            count = counts[a]
            if counts[a] >= 2:
                target = a
            else:
                ans.append(a)
        else:
            counts[a] -= 1
            if a == target:
                counts[a] -= 1
                target = None
    # print(la[start:], lc)
    # print(lb, loop)
    print(" ".join(map(str, ans)))


if __name__ == '__main__':
    main()
