using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using static System.Console;
using static System.Math;

namespace AtTest._600problems
{
    class ARC098_E
    {
        static void Main(string[] args)
        {
            Method(args);
        }

        static void Method(string[] args)
        {
            int[] nkq = ReadInts();
            int n = nkq[0];
            int k = nkq[1];
            int q = nkq[2];
            int[] array = ReadInts();

            int[][] valPos = new int[n][];
            for(int i = 0; i < n; i++)
            {
                valPos[i] = new int[2] { array[i], i };
            }
            Array.Sort(valPos, (a, b) => a[0] - b[0]);

            int res = int.MaxValue;
            for(int i = 0; i < n; i++)
            {
                bool[] exclude = new bool[n];

                int remain = 0;
                for(int j = 0; j < n; j++)
                {
                    if (array[j] < array[i]) remain = k;

                    if (remain > 0) exclude[j] = true;
                    remain--;
                }
                remain = 0;
                for (int j = n-1; j >=0; j--)
                {
                    if (array[j] < array[i]) remain = k;

                    if (remain > 0) exclude[j] = true;
                    remain--;
                }

                int now = 0;
                for(int j = 0; j < n; j++)
                {
                    if (exclude[valPos[j][1]]) continue;

                    now++;
                    if (now == q)
                    {
                        res = Min(res, valPos[j][0] - array[i]);
                        break;
                    }
                }
            }

            WriteLine(res);
        }

        private static string Read() { return ReadLine(); }
        private static char[] ReadChars() { return Array.ConvertAll(Read().Split(), a => a[0]); }
        private static int ReadInt() { return int.Parse(Read()); }
        private static long ReadLong() { return long.Parse(Read()); }
        private static double ReadDouble() { return double.Parse(Read()); }
        private static int[] ReadInts() { return Array.ConvertAll(Read().Split(), int.Parse); }
        private static long[] ReadLongs() { return Array.ConvertAll(Read().Split(), long.Parse); }
        private static double[] ReadDoubles() { return Array.ConvertAll(Read().Split(), double.Parse); }
    }
}
