# -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
import sys
import time
from collections import Counter, defaultdict
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product


def read_int():
    return int(input())


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


def read_float():
    return float(input())


def read_float_n():
    return list(map(float, input().split()))


def read_str():
    return input()


def read_str_n():
    return list(map(str, input().split()))


def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


@mt
def slv(N, K, Q, A):

    ans = sys.maxsize
    for a in A:
        P = []
        s = None
        for i in range(N):
            if A[i] >= a:
                if s is None:
                    s = i
            else:
                if s is not None:
                    P.append((s, i))
                    s = None
        if s is not None:
            P.append((s, N))
        B = []
        for s, e in P:
            if e - s - K + 1 > 0:
                t = sorted(A[s:e + 1])[:e - s - K + 1]
                B.extend(t)

        B.sort()
        if len(B) > Q - 1:
            ans_cnd = B[Q - 1] - B[0]
            ans = ans if ans < ans_cnd else ans_cnd
    return ans


def main():
    N, K, Q = read_int_n()
    A = read_int_n()

    # N = 2000
    # K = random.randint(1, N)
    # Q = random.randint(1, N - K + 1)
    # A = [random.randint(1, 1000000000) for _ in range(N)]
    print(slv(N, K, Q, A))


if __name__ == '__main__':
    main()
