#[allow(unused_imports)]
use proconio::{input, marker::*};

#[allow(unused_imports)]
use std::collections::{BTreeMap, BTreeSet, BinaryHeap, HashMap, HashSet, VecDeque};

#[allow(unused_imports)]
use std::io::Write;

#[allow(unused_macros)]
macro_rules! debug {
    ($($a:expr),*) => {
        #[cfg(debug_assertions)]
        writeln!(&mut std::io::stderr(), concat!("[DEBUG] ", $(stringify!($a), "={:?} "),*), $($a),*).unwrap();
    }
}

fn main() {
    input! {
        n: usize,
        k: usize,
        q: usize,
        a: [usize; n],
    }

    let mut mn = std::usize::MAX;
    for i in 0..n {
        let x = a[i];
        let mut tmp = Vec::new();
        let mut arrays = Vec::new();
        for j in 0..n {
            if a[j] < x {
                let mut t = Vec::new();
                std::mem::swap(&mut t, &mut tmp);
                arrays.push(t);
            } else {
                tmp.push(a[j]);
            }
        }
        arrays.push(tmp);
        let mut vec = Vec::new();
        for mut v in arrays {
            if v.len() < k {
                continue;
            }
            v.sort();
            for l in 0..v.len() - k + 1 {
                vec.push(v[l]);
            }
        }
        vec.sort();
        if vec.len() < q {
            continue;
        }
        let y = vec[q - 1];
        macro_rules ! min { ( $ x : expr ) => ( $ x ) ; ( $ x : expr , $ ( $ z : expr ) ,+ ) => { { std :: cmp :: min ( $ x , min ! ( $ ( $ z ) ,* ) ) } } }
        mn = min!(mn, y - x);
    }
    println!("{}", mn);
}
