# -*- 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):
    if Q == 1:
        return 0
    ans = sys.maxsize
    for i in range(N):
        x = A[i]
        s = 0
        yc = []
        for j in range(N):
            if A[j] < x:
                for c in sorted(A[s:j])[:len(A[s:j]) - Q + 1]:
                    bisect.insort(yc, c)
                s = j + 1
        else:
            for c in sorted(A[s:])[:len(A[s:]) - Q + 1]:
                bisect.insort(yc, c)

        if yc and len(yc) > Q - 1:
            ans = ans if ans < yc[Q - 1] - x else yc[Q - 1] - x

    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()
