10 5 1000000000
1 1 1 2 2 1 2 2 2 2
 5 3 3
1 2 2 1 1
 2 4 1
1 1
 1 1000000000 1000000000
100000
 5 3 2
1 1 2 1 1
 5 2 4
1 2 3 2 1
 1 10 10
1

10000000000
 0
 2
 0
 7
 0
 0

n,k,m = map(int, input().split())
a = input()
a = list(map(int, a.split()))
b = []
ostatok = 0
kol = 0
if n == 1:
    ostatok = m - m//10*9
else:
    for i in range(m):
        for j in range(n):
            b.append(a[j])
    i = 0
    dl = len(b)
    while i <= dl-k:
        for j in range(i,i+k-1):
            if b[j] == b[j+1]:
                kol += 1
        if kol == k-1:
            j = i
            while j != i+k:
                del(b[j])
                j += 1
            i = 0
        else:
            i += 1
        kol = 0
        dl = len(b)
                
                    
