package com.mbc.meituan;
import java.util.Scanner;
//第4题合并两个有序数组找出第K大数
public class Chazhao {
public static void merge(int a[], int b[],int p )
{
int[] result = new
int[a.length+b.length];
int i=0,j=0,k=0;
while(i<a.length && j<b.length)
if(a[i] <= b[j])
{
result[k++] = a[i++];
}
else
{
result[k++] = b[j++];
}
while(i < a.length)
result[k++] = a[i++];
while(j < b.length)
result[k++] = b[j++];
int length=result.length;
System.out.print(result[length-p]);
}
public static void main(String[] args) throws Exception
{
int [] A={1,2,3};
int [] B={2,4,6};
int n=A.length;
int m=B.length;
Scanner in=new Scanner(System.in);
int p=in.nextInt();
merge(A, B, p);
}
}