import java.util.Scanner;
import java.util.*;


public class Main{


    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int x = sc.nextInt();
        int y = sc.nextInt();

        int[] scores = new int[n];
        for(int i=0;i<n;i++) scores[i] = sc.nextInt();
        Arrays.sort(scores);

        //dp[i] 代表 以scores[i-1]为分界线能够淘汰的人数 
        int[] dp = new int[n+1];

        dp[0] = 0;

        for(int i=0;i<n;i++){
            int pre = i;
            while(i<n-1 && scores[i]==scores[i+1]) i++;
            //判断相等分数的人数
            int num = i-pre+1;
            for(int j=pre;j<=i && j<n;j++){
                dp[j+1] = dp[pre] + num;
            }
        }

        //寻找最先符合的情况
        for(int i=1;i<=n;i++){
            if(dp[i]>=x && dp[i]<=y && n-dp[i] >= x && n-dp[i]<=y){
                System.out.println(scores[i-1]);
                return;
            }
        }
        System.out.println(-1);


    }
}