#include <stdio.h>
#include <stdlib.h>

#define N 2000

int hh[N];

int compare1(const void *a, const void *b) {
	int i = *(int *) a;
	int j = *(int *) b;
	int diff1 = hh[i] - hh[j];
	int diff2 = i - j;

	return diff1 != 0 ? diff1 : diff2;
}

int compare2(const void *a, const void *b) {
	int i = *(int *) a;
	int j = *(int *) b;
	int diff1 = hh[i] - hh[j];
	int diff2 = j - i;

	return diff1 != 0 ? diff1 : diff2;
}

int x = 0;

int compare3(const void *a, const void *b) {
	int i = *(int *) a;
	int j = *(int *) b;
	int diff1 = hh[i] - hh[j];
	int diff2 = x % 2 == 0 ? j - i : i - j;
	x++;

	return diff1 != 0 ? diff1 : diff2;
}

int same(int n, int *aa, int *bb) {
	int i;

	for (i = 0; i < n; i++)
		if (aa[i] != bb[i])
			return 0;
	return 1;
}

int main() {
	static int ii1[N], ii2[N], ii3[N];
	int n, i;

	scanf("%d", &n);
	for (i = 0; i < n; i++) {
		scanf("%d", &hh[i]);
		ii1[i] = i;
		ii2[i] = i;
		ii3[i] = i;
	}
	qsort(ii1, n, sizeof *ii1, compare1);
	qsort(ii2, n, sizeof *ii2, compare2);
	qsort(ii3, n, sizeof *ii3, compare3);
	if (same(n, ii1, ii2) || same(n, ii1, ii3) || same(n, ii2, ii3)) {
		printf("NO\n");
		return 0;
	}
	printf("YES\n");
	for (i = 0; i < n; i++)
		printf("%d ", ii1[i] + 1);
	printf("\n");
	for (i = 0; i < n; i++)
		printf("%d ", ii2[i] + 1);
	printf("\n");
	for (i = 0; i < n; i++)
		printf("%d ", ii3[i] + 1);
	printf("\n");
	return 0;
}


/* Coached by rainboy */
#include <stdio.h>
#include <stdlib.h>

#define N 2000

int hh[N];

int compare(const void *a, const void *b) {
	int i = *(int *) a;
	int j = *(int *) b;

	return hh[i] - hh[j];
}

int main() {
	static int ii[N];
	int n, i, i1, i2, tmp;

	scanf("%d", &n);
	for (i = 0; i < n; i++) {
		scanf("%d", &hh[i]);
		ii[i] = i;
	}
	qsort(ii, n, sizeof *ii, compare);
	i1 = i2 = -1;
	for (i = 1; i < n; i++)
		if (hh[ii[i - 1]] == hh[ii[i]]) {
			if (i1 == -1)
				i1 = i;
			else if (i2 == -1)
				i2 = i;
		}
	if (i2 == -1) {
		printf("NO\n");
		return 0;
	}
	printf("YES\n");
	for (i = 0; i < n; i++)
		printf("%d ", ii[i] + 1);
	printf("\n");
	tmp = ii[i1 - 1];
	ii[i1 - 1] = ii[i1];
	ii[i1] = tmp;
	for (i = 0; i < n; i++)
		printf("%d ", ii[i] + 1);
	printf("\n");
	tmp = ii[i1 - 1];
	ii[i1 - 1] = ii[i1];
	ii[i1] = tmp;
	tmp = ii[i2 - 1];
	ii[i2 - 1] = ii[i2];
	ii[i2] = tmp;
	for (i = 0; i < n; i++)
		printf("%d ", ii[i] + 1);
	printf("\n");
	tmp = ii[i2 - 1];
	ii[i2 - 1] = ii[i2];
	ii[i2] = tmp;
	return 0;
}


#include <stdio.h>
#include <stdlib.h>

#define N 2000

int hh[N];

int compare1(const void *a, const void *b) {
	int i = *(int *) a;
	int j = *(int *) b;
	int diff1 = hh[i] - hh[j];
	int diff2 = i - j;

	return diff1 != 0 ? diff1 : diff2;
}

int x = 0;

int compare2(const void *a, const void *b) {
	int i = *(int *) a;
	int j = *(int *) b;
	int diff1 = hh[i] - hh[j];
	int diff2 = x % 2 == 0 ? j - i : i - j;
	x++;

	return diff1 != 0 ? diff1 : diff2;
}

int compare3(const void *a, const void *b) {
	int i = *(int *) a;
	int j = *(int *) b;
	int diff1 = hh[i] - hh[j];
	int diff2 = j - i;

	return diff1 != 0 ? diff1 : diff2;
}

int same(int n, int *aa, int *bb) {
	int i;

	for (i = 0; i < n; i++)
		if (aa[i] != bb[i])
			return 0;
	return 1;
}

int main() {
	static int ii1[N], ii2[N], ii3[N];
	int n, i;

	scanf("%d", &n);
	for (i = 0; i < n; i++) {
		scanf("%d", &hh[i]);
		ii1[i] = i;
		ii2[i] = i;
		ii3[i] = i;
	}
	qsort(ii1, n, sizeof *ii1, compare1);
	qsort(ii2, n, sizeof *ii2, compare2);
	qsort(ii3, n, sizeof *ii3, compare3);
	printf("YES\n");
	for (i = 0; i < n; i++)
		printf("%d ", ii1[i] + 1);
	printf("\n");
	for (i = 0; i < n; i++)
		printf("%d ", ii2[i] + 1);
	printf("\n");
	for (i = 0; i < n; i++)
		printf("%d ", ii3[i] + 1);
	printf("\n");
	return 0;
}


using System;
using System.Linq;
using System.Collections.Generic;
class CodeForces471B{
	static IEnumerable<List<T>> Permutation<T>(List<T> x,int? _n=null) where T : IComparable<T>{
		int n=_n ?? x.Count;
		if(n<0||x.Count<n)yield break;
		List<T> a=new List<T>(x);
		a.Sort();
		for(;;){
			yield return a.GetRange(0,n);
			int i;
			a.Reverse(n,a.Count-n);
			for(i=a.Count-2;i>=0;i--)if(a[i].CompareTo(a[i+1])<0)break;
			if(i<0){
				//a.Reverse(0,a.Count);
				/*yield*/ break;
			}
			int k=i;
			for(i=a.Count-1;i>=k+1;i--)if(a[k].CompareTo(a[i])<0)break;
			int l=i;
			T z=a[k];a[k]=a[l];a[l]=z;
			a.Reverse(k+1,a.Count-(k+1));
		}
	}
	static IEnumerable<List<int>> dfs(List<List<int>> list,int d,List<int>result){
		if(d==list.Count){
			yield return result;
		}else{
			int siz=result.Count;
			foreach(var e in Permutation(list[d])){
				result.AddRange(e);
				foreach(var _ in dfs(list,d+1,result))yield return _;
				result.RemoveRange(siz,e.Count);
			}
		}
	}
	static void Main(){
		int n=int.Parse(Console.ReadLine());
		int[] a=Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
		SortedDictionary<int,List<int>> dict=new SortedDictionary<int,List<int>>();
		for(int i=0;i<n;i++){
			if(!dict.ContainsKey(a[i]))dict[a[i]]=new List<int>();
			dict[a[i]].Add(i+1);
		}
		List<List<int>> list=new List<List<int>>();
		long comb=1,threshold=3;
		foreach(var e in dict){
			if(comb<threshold)comb*=e.Value.Count;
			list.Add(e.Value);
		}
		if(comb<threshold){
			Console.WriteLine("NO");
		}else{
			Console.WriteLine("YES");
			int cnt=0;
			foreach(var e in dfs(list,0,new List<int>())){
				for(int i=0;i<e.Count;i++){
					if(i>0)Console.Write(" ");
					Console.Write(e[i]);
				}
				Console.WriteLine();
				cnt++;
				if(cnt==3)break;
			}
		}
	}
}


using System;
using System.Linq;
using System.Collections.Generic;
class CodeForces471B{
	static IEnumerable<List<T>> Permutation<T>(List<T> x,int? _n=null) where T : IComparable<T>{
		int n=_n ?? x.Count;
		if(n<0||x.Count<n)yield break;
		List<T> a=new List<T>(x);
		a.Sort();
		for(;;){
			yield return a.GetRange(0,n);
			int i;
			a.Reverse(n,a.Count-n);
			for(i=a.Count-2;i>=0;i--)if(a[i].CompareTo(a[i+1])<0)break;
			if(i<0){
				//a.Reverse(0,a.Count);
				/*yield*/ break;
			}
			int k=i;
			for(i=a.Count-1;i>=k+1;i--)if(a[k].CompareTo(a[i])<0)break;
			int l=i;
			T z=a[k];a[k]=a[l];a[l]=z;
			a.Reverse(k+1,a.Count-(k+1));
		}
	}
	static IEnumerable<List<int>> dfs(List<List<int>> list,int d,List<int>result){
		if(d==list.Count){
			yield return result;
		}else{
			int siz=result.Count;
			foreach(var e in Permutation(list[d])){
				result.AddRange(e);
				foreach(var _ in dfs(list,d+1,result))yield return _;
				result.RemoveRange(siz,e.Count);
			}
		}
	}
	static void Main(){
		int n=int.Parse(Console.ReadLine());
		int[] a=Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
		SortedDictionary<int,List<int>> dict=new SortedDictionary<int,List<int>>();
		for(int i=0;i<n;i++){
			if(!dict.ContainsKey(a[i]))dict[a[i]]=new List<int>();
			dict[a[i]].Add(i+1);
		}
		List<List<int>> list=new List<List<int>>();
		long comb=1;
		foreach(var e in dict){
			comb*=e.Value.Count;
			list.Add(e.Value);
		}
		if(comb<3){
			Console.WriteLine("NO");
		}else{
			Console.WriteLine("YES");
			int cnt=0;
			foreach(var e in dfs(list,0,new List<int>())){
				for(int i=0;i<e.Count;i++){
					if(i>0)Console.Write(" ");
					Console.Write(e[i]);
				}
				Console.WriteLine();
				cnt++;
				if(cnt==3)break;
			}
		}
	}
}


using System;
using System.Linq;
using System.Collections.Generic;
class CodeForces471B{
	static IEnumerable<List<T>> Permutation<T>(List<T> x,int? _n=null) where T : IComparable<T>{
		int n=_n ?? x.Count;
		if(n<0||x.Count<n)yield break;
		List<T> a=new List<T>(x);
		a.Sort();
		for(;;){
			yield return a.GetRange(0,n);
			int i;
			a.Reverse(n,a.Count-n);
			for(i=a.Count-2;i>=0;i--)if(a[i].CompareTo(a[i+1])<0)break;
			if(i<0){
				//a.Reverse(0,a.Count);
				/*yield*/ break;
			}
			int k=i;
			for(i=a.Count-1;i>=k+1;i--)if(a[k].CompareTo(a[i])<0)break;
			int l=i;
			T z=a[k];a[k]=a[l];a[l]=z;
			a.Reverse(k+1,a.Count-(k+1));
		}
	}
	static IEnumerable<List<int>> dfs(List<List<int>> list,int d,List<int>result){
		if(d==list.Count){
			yield return result;
		}else{
			int siz=result.Count;
			foreach(var e in Permutation(list[d])){
				result.AddRange(e);
				foreach(var _ in dfs(list,d+1,result))yield return _;
				result.RemoveRange(siz,e.Count);
			}
		}
	}
	static void Main(){
		int n=int.Parse(Console.ReadLine());
		int[] a=Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
		SortedDictionary<int,List<int>> dict=new SortedDictionary<int,List<int>>();
		for(int i=0;i<n;i++){
			if(!dict.ContainsKey(a[i]))dict[a[i]]=new List<int>();
			dict[a[i]].Add(i+1);
		}
		List<List<int>> list=new List<List<int>>();
		long comb=1;
		foreach(var e in dict){
			comb*=e.Value.Count;
			list.Add(e.Value);
		}
		if(n==2000)Console.WriteLine(comb);
		if(comb<3){
			Console.WriteLine("NO");
		}else{
			Console.WriteLine("YES");
			int cnt=0;
			foreach(var e in dfs(list,0,new List<int>())){
				for(int i=0;i<e.Count;i++){
					if(i>0)Console.Write(" ");
					Console.Write(e[i]);
				}
				Console.WriteLine();
				cnt++;
				if(cnt==3)break;
			}
		}
	}
}


using System;
using System.Linq;
using System.Collections.Generic;
class CodeForces471B{
	static IEnumerable<List<T>> Permutation<T>(List<T> x,int? _n=null) where T : IComparable<T>{
		int n=_n ?? x.Count;
		if(n<0||x.Count<n)yield break;
		List<T> a=new List<T>(x);
		a.Sort();
		for(;;){
			yield return a.GetRange(0,n);
			int i;
			a.Reverse(n,a.Count-n);
			for(i=a.Count-2;i>=0;i--)if(a[i].CompareTo(a[i+1])<0)break;
			if(i<0){
				//a.Reverse(0,a.Count);
				/*yield*/ break;
			}
			int k=i;
			for(i=a.Count-1;i>=k+1;i--)if(a[k].CompareTo(a[i])<0)break;
			int l=i;
			T z=a[k];a[k]=a[l];a[l]=z;
			a.Reverse(k+1,a.Count-(k+1));
		}
	}
	static IEnumerable<List<int>> dfs(List<List<int>> list,int d,List<int>result){
		if(d==list.Count){
			yield return result;
		}else{
			int siz=result.Count;
			foreach(var e in Permutation(list[d])){
				result.AddRange(e);
				foreach(var _ in dfs(list,d+1,result))yield return _;
				result.RemoveRange(siz,e.Count);
			}
		}
	}
	static void Main(){
		int n=int.Parse(Console.ReadLine());
		int[] a=Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
		SortedDictionary<int,List<int>> dict=new SortedDictionary<int,List<int>>();
		for(int i=0;i<n;i++){
			if(!dict.ContainsKey(a[i]))dict[a[i]]=new List<int>();
			dict[a[i]].Add(i+1);
		}
		List<List<int>> list=new List<List<int>>();
		long comb=1,threshold=3;
		foreach(var e in dict){
			if(comb<threshold)comb*=e.Value.Count;
			list.Add(e.Value);
		}
		if(comb<threshold){
			Console.WriteLine("NO");
		}else{
			Console.WriteLine("YES");
			int cnt=0;
			foreach(var e in dfs(list,0,new List<int>())){
				for(int i=0;i<e.Count;i++){
					if(i>0)Console.Write(" ");
					Console.Write(e[i]);
				}
				Console.WriteLine();
				cnt++;
				if(cnt==threshold)break;
			}
		}
	}
}


import java.util.Arrays;
import java.util.Hashtable;
import java.util.Scanner;

public class Round111ProbC {

    public static void main(String[] args) {

        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        long k = in.nextLong()-1;
        int[] a = new int[n+3];
        for (int i = 0; i < n; i++)
        {
         a[i] = in.nextInt();
        }
        a[n] = a[n+1] = a[n+2] = 1000000000+2;
        Arrays.sort(a);
        int i = (int)(k / n);

        int j = (int)(k % n);

        int x =1;
        int shift =0;
        for(int q = i-1;q > -1;q--)
            if(a[q] == a[i]){x++;shift += n;}else break;
        for(int q = i+1;q < n;q++)
            if(a[q] == a[i])x++;else break;
        System.out.println(a[i] + " " + a[(shift+j)/x]);
    }
}


import java.util.Arrays;
import java.util.Scanner;

public class Round111ProbC {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        long k = in.nextLong()-1;

        long[] a = new long[n];
        for (int i = 0; i < n; i++)
            a[i] = in.nextLong();

        Arrays.sort(a);
        long i = k / n;
        long j = k % n;
        System.out.println(a[(int)i] + " " + a[(int)j]);

    }

}


import java.util.Arrays;
import java.util.Scanner;

public class Round111ProbC {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        long k = in.nextInt()-1;

        long[] a = new long[n];
        for (int i = 0; i < n; i++)
            a[i] = in.nextLong();

        Arrays.sort(a);
        long i = k / n;
        long j = k % n;
        System.out.println(a[(int)i] + " " + a[(int)j]);

    }

}


import java.util.Arrays;
import java.util.Hashtable;
import java.util.Scanner;

public class Round111ProbC {

    public static void main(String[] args) {

        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        long k = in.nextLong()-1;
        int[] a = new int[n+3];
        for (int i = 0; i < n; i++)
        {
         a[i] = in.nextInt();
        }
        a[n] = a[n+1] = a[n+2] = 1000000000+2;
        Arrays.sort(a);
        int i = (int)(k / n);

        int j = (int)(k % n);

        int x =1;
        long shift =0;
        for(int q = i-1;q > -1;q--)
            if(a[q] == a[i]){x++;shift += n;}else break;
        for(int q = i+1;q < n;q++)
            if(a[q] == a[i])x++;else break;
        System.out.println(a[i] + " " + a[(int)((shift+j)/x)]);
    }
}


import java.util.Arrays;
import java.util.Scanner;

public class Round111ProbC {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int k = in.nextInt()-1;

        long[] a = new long[n];
        for (int i = 0; i < n; i++)
            a[i] = in.nextLong();

        Arrays.sort(a);
        int i = k / n;
        int j = k % n;
        System.out.println(a[i] + " " + a[j]);

    }

}


import java.util.Arrays;
import java.util.Scanner;

public class Round111ProbC {

    public static void main(String[] args) {

        Scanner in = new Scanner(System.in);

        int n = in.nextInt();
        long k = in.nextLong()-1;
        long[] a = new long[n];
        for (int i = 0; i < n; i++)
            a[i] = in.nextLong();

        Arrays.sort(a);
        int i = (int)(k / n);

        int j = (int)(k % n);

        int x =1;
        int shift =0;
        for(int q = i-1;q > -1;q--)
            if(a[q] == a[i]){x++;shift += n;}else break;
        for(int q = i+1;q < n;q++)
            if(a[q] == a[i])x++;else break;
        System.out.println(a[i] + " " + a[(shift+j)/x]);
    }
}


import java.util.Scanner;
public class Main {

	long n;
	long k;
	long [] numbers;
	Scanner input;

	public Main(){

		input=new Scanner(System.in);
	}

	public void getInput(){

		n=input.nextInt();
		k=input.nextLong();
	    numbers =new long[(int) n];
	    for(int i=0;i<numbers.length;i++){

	    	numbers[i]=input.nextLong();
	    }

	}

	public static void main(String [] args){

		Main test=new Main();
		test.process();

	}
	public void process(){

		this.getInput();
		this.mergesort(numbers,0,numbers.length-1);
		//for(int i=0;i<numbers.length;i++){
			//System.out.print(i+"_ "+numbers[i]);
		//}

		long loc=k-1;
		long w=(loc/n);
		//System.out.println("W:"+w);
		long re=loc%n;
		//System.out.println("Remainder:"+re);
		int x=(int)numbers[(int)w];
		//System.out.println("number:"+numbers[(int)re]);
		int y=(int)numbers[(int)re];
		long c1=0;
		for(int i=0;i<numbers.length;i++){
			if(numbers[i]==x){
				c1++;
			}
		}
		if(c1==1){
			y=(int)numbers[(int)re];

		}else{
			int ii=(int)(w-1);
			for(ii=(int)(w-1);ii>=-1;ii--){
				if(ii==-1 || numbers[ii]!=numbers[(int) w]){
					break;
				}
			}
			//System.out.println("ii:"+ii);
			int s=(int)(n*(ii+1));
			int q=Math.abs((int)(loc-s));
			//System.out.println("Q:"+q);
			y=(int)numbers[(int)(q/c1)];

		}

		System.out.println(""+x+" "+y);

	}

public void mergesort(long [] A,int s,int e){

		if(s<e){
			int q=(s+e)/2;
			this.mergesort(A, s, q);
			this.mergesort(A, q+1, e);
			this.merge(A,s,q,e);

		}

	}

public void merge(long [] A,int s,int m,int e){

	int left=m-s+1;
	int right=e-m;
	//int k=0;
	int l=0;int r=0;
	left=left+1;
	right++;
	int[] LA=new int[left];
	int [] RA=new int[right];

	LA[left-1]=Integer.MAX_VALUE;
	RA[right-1]=Integer.MAX_VALUE;

	for(int i=0;i<left-1;i++){
		LA[i]=(int)A[s+i];

	}

	for(int j=0;j<right-1;j++){
		RA[j]=(int)A[m+1+j];
	}

	l=0;r=0;
	for(int i=s;i<=e;i++){

		if(LA[l]>=RA[r]){
			A[i]=RA[r];
			r++;
		}
		else {
			A[i]=LA[l];
			l++;
		}

	}

}

}


import java.util.Scanner;
public class Main {

	int n;
	long k;
	int [] numbers;
	Scanner input;

	public Main(){

		input=new Scanner(System.in);
	}

	public void getInput(){

		n=input.nextInt();
		k=input.nextLong();
	    numbers =new int[n];
	    for(int i=0;i<numbers.length;i++){

	    	numbers[i]=input.nextInt();
	    }

	}

	public static void main(String [] args){

		Main test=new Main();
		test.process();

	}
	public void process(){

		this.getInput();
		this.mergesort(numbers,0,numbers.length-1);
		//for(int i=0;i<numbers.length;i++){
			//System.out.print(i+"_ "+numbers[i]);
		//}

		long loc=k-1;
		long w=(loc/n);
		//System.out.println("Q:"+w);
		long re=loc%n;
		//System.out.println("Remainder:"+re);
		int x=numbers[(int)w];
		//System.out.println("number:"+numbers[(int)re]);
		int y=numbers[(int)re];
		int c1=0;
		for(int i=0;i<numbers.length;i++){
			if(numbers[i]==x){
				c1=c1+1;
			}
		}
		if(c1==1){
			y=numbers[(int)re];

		}else{

			for(int k=(int)(w-1);k>=-1;k--){
				if(k==-1 || numbers[k]!=numbers[(int) w]){
					break;
				}
			}

			int s=(int)(n*(k+1));
			int q=(int)(loc-s);
			y=numbers[q%c1];

		}

		System.out.println(""+x+" "+y);

	}

public void mergesort(int [] A,int s,int e){

		if(s<e){
			int q=(s+e)/2;
			this.mergesort(A, s, q);
			this.mergesort(A, q+1, e);
			this.merge(A,s,q,e);

		}

	}

public void merge(int [] A,int s,int m,int e){

	int left=m-s+1;
	int right=e-m;
	//int k=0;
	int l=0;int r=0;
	left=left+1;
	right++;
	int[] LA=new int[left];
	int [] RA=new int[right];

	LA[left-1]=Integer.MAX_VALUE;
	RA[right-1]=Integer.MAX_VALUE;

	for(int i=0;i<left-1;i++){
		LA[i]=A[s+i];

	}

	for(int j=0;j<right-1;j++){
		RA[j]=A[m+1+j];
	}

	l=0;r=0;
	for(int i=s;i<=e;i++){

		if(LA[l]>=RA[r]){
			A[i]=RA[r];
			r++;
		}
		else {
			A[i]=LA[l];
			l++;
		}

	}

}

}


import java.util.Scanner;
public class Main {

	int n;
	long k;
	int [] numbers;
	Scanner input;

	public Main(){

		input=new Scanner(System.in);
	}

	public void getInput(){

		n=input.nextInt();
		k=input.nextLong();
	    numbers =new int[n];
	    for(int i=0;i<numbers.length;i++){

	    	numbers[i]=input.nextInt();
	    }

	}

	public static void main(String [] args){

		Main test=new Main();
		test.process();

	}
	public void process(){

		this.getInput();
		this.mergesort(numbers,0,numbers.length-1);
		//for(int i=0;i<numbers.length;i++){
			//System.out.print(i+"_ "+numbers[i]);
		//}

		long loc=k-1;
		long w=(loc/n);
		//System.out.println("Q:"+w);
		long re=loc%n;
		//System.out.println("Remainder:"+re);
		int x=numbers[(int)w];
		//System.out.println("number:"+numbers[(int)re]);
		int y=numbers[(int)re];
		System.out.println(""+x+" "+y);

	}

public void mergesort(int [] A,int s,int e){

		if(s<e){
			int q=(s+e)/2;
			this.mergesort(A, s, q);
			this.mergesort(A, q+1, e);
			this.merge(A,s,q,e);

		}

	}

public void merge(int [] A,int s,int m,int e){

	int left=m-s+1;
	int right=e-m;
	//int k=0;
	int l=0;int r=0;
	left=left+1;
	right++;
	int[] LA=new int[left];
	int [] RA=new int[right];

	LA[left-1]=Integer.MAX_VALUE;
	RA[right-1]=Integer.MAX_VALUE;

	for(int i=0;i<left-1;i++){
		LA[i]=A[s+i];

	}

	for(int j=0;j<right-1;j++){
		RA[j]=A[m+1+j];
	}

	l=0;r=0;
	for(int i=s;i<=e;i++){

		if(LA[l]>=RA[r]){
			A[i]=RA[r];
			r++;
		}
		else {
			A[i]=LA[l];
			l++;
		}

	}

}

}


import java.util.Scanner;
public class Main {

	int n;
	long k;
	int [] numbers;
	Scanner input;

	public Main(){

		input=new Scanner(System.in);
	}

	public void getInput(){

		n=input.nextInt();
		k=input.nextLong();
	    numbers =new int[n];
	    for(int i=0;i<numbers.length;i++){

	    	numbers[i]=input.nextInt();
	    }

	}

	public static void main(String [] args){

		Main test=new Main();
		test.process();

	}
	public void process(){

		this.getInput();
		this.mergesort(numbers,0,numbers.length-1);
		//for(int i=0;i<numbers.length;i++){
			//System.out.print(i+"_ "+numbers[i]);
		//}

		long loc=k-1;
		long w=(loc/n);
		//System.out.println("W:"+w);
		long re=loc%n;
		//System.out.println("Remainder:"+re);
		int x=numbers[(int)w];
		//System.out.println("number:"+numbers[(int)re]);
		int y=numbers[(int)re];
		int c1=0;
		for(int i=0;i<numbers.length;i++){
			if(numbers[i]==x){
				c1=c1+1;
			}
		}
		if(c1==1){
			y=numbers[(int)re];

		}else{
			int ii=(int)(w-1);
			for(ii=(int)(w-1);ii>=-1;ii--){
				if(ii==-1 || numbers[ii]!=numbers[(int) w]){
					break;
				}
			}
			//System.out.println("ii:"+ii);
			int s=(int)(n*(ii+1));
			int q=(int)(loc-s);
			//System.out.println("Q:"+q);
			y=numbers[q/c1];

		}

		System.out.println(""+x+" "+y);

	}

public void mergesort(int [] A,int s,int e){

		if(s<e){
			int q=(s+e)/2;
			this.mergesort(A, s, q);
			this.mergesort(A, q+1, e);
			this.merge(A,s,q,e);

		}

	}

public void merge(int [] A,int s,int m,int e){

	int left=m-s+1;
	int right=e-m;
	//int k=0;
	int l=0;int r=0;
	left=left+1;
	right++;
	int[] LA=new int[left];
	int [] RA=new int[right];

	LA[left-1]=Integer.MAX_VALUE;
	RA[right-1]=Integer.MAX_VALUE;

	for(int i=0;i<left-1;i++){
		LA[i]=A[s+i];

	}

	for(int j=0;j<right-1;j++){
		RA[j]=A[m+1+j];
	}

	l=0;r=0;
	for(int i=s;i<=e;i++){

		if(LA[l]>=RA[r]){
			A[i]=RA[r];
			r++;
		}
		else {
			A[i]=LA[l];
			l++;
		}

	}

}

}


import java.util.Scanner;
public class Main {

	int n;
	long k;
	int [] numbers;
	Scanner input;

	public Main(){

		input=new Scanner(System.in);
	}

	public void getInput(){

		n=input.nextInt();
		k=input.nextLong();
	    numbers =new int[n];
	    for(int i=0;i<numbers.length;i++){

	    	numbers[i]=input.nextInt();
	    }

	}

	public static void main(String [] args){

		Main test=new Main();
		test.process();

	}
	public void process(){

		this.getInput();
		this.mergesort(numbers,0,numbers.length-1);
		//for(int i=0;i<numbers.length;i++){
			//System.out.print(i+"_ "+numbers[i]);
		//}

		long loc=k-1;
		long w=(loc/n);
		//System.out.println("Q:"+w);
		long re=loc%n;
		//System.out.println("Remainder:"+re);
		int x=numbers[(int)w];
		//System.out.println("number:"+numbers[(int)re]);
		int y=numbers[(int)re];
		int c1=0;
		for(int i=0;i<numbers.length;i++){
			if(numbers[i]==x){
				c1=c1+1;
			}
		}
		if(c1==1){
			y=numbers[(int)re];

		}else{

			for(int k=(int)(w-1);k>=-1;k--){
				if(k==-1 || numbers[k]!=numbers[(int) w]){
					break;
				}
			}

			int s=(int)(n*(k+1));
			int q=(int)(s-loc);
			y=numbers[q%c1];

		}

		System.out.println(""+x+" "+y);

	}

public void mergesort(int [] A,int s,int e){

		if(s<e){
			int q=(s+e)/2;
			this.mergesort(A, s, q);
			this.mergesort(A, q+1, e);
			this.merge(A,s,q,e);

		}

	}

public void merge(int [] A,int s,int m,int e){

	int left=m-s+1;
	int right=e-m;
	//int k=0;
	int l=0;int r=0;
	left=left+1;
	right++;
	int[] LA=new int[left];
	int [] RA=new int[right];

	LA[left-1]=Integer.MAX_VALUE;
	RA[right-1]=Integer.MAX_VALUE;

	for(int i=0;i<left-1;i++){
		LA[i]=A[s+i];

	}

	for(int j=0;j<right-1;j++){
		RA[j]=A[m+1+j];
	}

	l=0;r=0;
	for(int i=s;i<=e;i++){

		if(LA[l]>=RA[r]){
			A[i]=RA[r];
			r++;
		}
		else {
			A[i]=LA[l];
			l++;
		}

	}

}

}


import java.util.Scanner;

public class Main {

	int n;
	int k;
	int [] num;
    Pair [] pair;
	Scanner input;

	public Main(){

		input=new Scanner(System.in);

	}
	public static void main(String [] args){

		Main test=new Main();
		//int [] num={32,1,6,3,6,8,2,39,3,92};
		//test.mergesort(num,0,9);
		//for(int i=0;i<num.length;i++){
		//	System.out.print(" "+num[i]);
		//}
	   test.process();

	}

	public void process(){
		this.getinput();
		this.generatePair();
	    this.mergesort_x(pair,0,pair.length-1);
		int x=pair[k-1].x;
		int s=0;
		for(int i=0;i<pair.length;i++){
			if(pair[i].x==x){
				s=i;

				break;

			}

		}
		//for(int i=0;i<pair.length;i++){
			//System.out.print(" "+pair[i].x);
		//}
		//System.out.println("&& "+(k-s));
		this.mergesort_y(pair,0,pair.length-1);
		int t=0;

		for(int i=0;i<pair.length;i++){
			//System.out.print(" "+pair[i].y+"->"+pair[i].x);
			if(pair[i].x==x){
				t=t+1;
		 	}

		    if(t==k-s){
		    	t=i;
		    	break;
		    }
		}
		int y=pair[t].y;
	    System.out.println(""+x+" "+y);

	}
	public void getinput(){

	n=input.nextInt();
	k=input.nextInt();
	pair=new Pair[(int)Math.pow(n,2)];
	num=new int[n];

	for(int i=0;i<num.length;i++){

		num[i]=input.nextInt();
	}

 	}

	public void generatePair(){

		int w=0;
		for(int i=0;i<num.length;i++){

			for(int j=0;j<num.length;j++){
				pair[w]=new Pair();
				pair[w].x=num[i];
				pair[w].y=num[j];
				w++;
			}
		}

	}

	public void mergesort_x(Pair [] A,int s,int e){

		if(s<e){
			int q=(s+e)/2;
			this.mergesort_x(A, s, q);
			this.mergesort_x(A, q+1, e);
			this.merge_x(A,s,q,e);

		}

	}

public void mergesort_y(Pair [] A,int s,int e){

		if(s<e){
			int q=(s+e)/2;
			this.mergesort_y(A, s, q);
			this.mergesort_y(A, q+1, e);
			this.merge_y(A,s,q,e);

		}

	}

	public void merge_x(Pair [] A,int s,int m,int e){

		int left=m-s+1;
		int right=e-m;
		//int k=0;
		int l=0;int r=0;
		left=left+1;
		right++;
		Pair [] LA=new Pair[left];
		Pair [] RA=new Pair[right];

		LA[left-1]=new Pair();
		RA[right-1]=new Pair();
		LA[left-1].x=Integer.MAX_VALUE;
		LA[left-1].y=Integer.MAX_VALUE;
		RA[right-1].x=Integer.MAX_VALUE;
		RA[right-1].y=Integer.MAX_VALUE;

		for(int i=0;i<left-1;i++){
			LA[i]=new Pair();
			LA[i]=A[s+i];

		}

		for(int j=0;j<right-1;j++){
			RA[j]=new Pair();
			RA[j]=A[m+1+j];
		}

		l=0;r=0;
		for(int i=s;i<=e;i++){

			if(LA[l].x>=RA[r].x){
				A[i]=RA[r];
				r++;
			}
			else {
				A[i]=LA[l];
				l++;
			}

		}

	}

public void merge_y(Pair [] A,int s,int m,int e){

	int left=m-s+1;
	int right=e-m;
	//int k=0;
	int l=0;int r=0;
	left=left+1;
	right++;
	Pair [] LA=new Pair[left];
	Pair [] RA=new Pair[right];

	LA[left-1]=new Pair();
	RA[right-1]=new Pair();
	LA[left-1].x=Integer.MAX_VALUE;
	LA[left-1].y=Integer.MAX_VALUE;
	RA[right-1].x=Integer.MAX_VALUE;
	RA[right-1].y=Integer.MAX_VALUE;

	for(int i=0;i<left-1;i++){
		LA[i]=new Pair();
		LA[i]=A[s+i];

	}

	for(int j=0;j<right-1;j++){
		RA[j]=new Pair();
		RA[j]=A[m+1+j];
	}

	l=0;r=0;
	for(int i=s;i<=e;i++){

		if(LA[l].y>=RA[r].y){
			A[i]=RA[r];
			r++;
		}
		else {
			A[i]=LA[l];
			l++;
		}

	}

}

}

class Pair{

	int x;
	int y;
}


import java.util.Scanner;
public class Main {

	long n;
	long k;
	long [] numbers;
	Scanner input;

	public Main(){

		input=new Scanner(System.in);
	}

	public void getInput(){

		n=input.nextInt();
		k=input.nextLong();
	    numbers =new long[(int) n];
	    for(int i=0;i<numbers.length;i++){

	    	numbers[i]=input.nextLong();
	    }

	}

	public static void main(String [] args){

		Main test=new Main();
		test.process();

	}
	public void process(){

		this.getInput();
		this.mergesort(numbers,0,numbers.length-1);
		//for(int i=0;i<numbers.length;i++){
			//System.out.print(i+"_ "+numbers[i]);
		//}

		long loc=k-1;
		long w=(loc/n);
		//System.out.println("W:"+w);
		long re=loc%n;
		//System.out.println("Remainder:"+re);
		int x=(int)numbers[(int)w];
		//System.out.println("number:"+numbers[(int)re]);
		int y=(int)numbers[(int)re];
		long c1=0;
		for(int i=0;i<numbers.length;i++){
			if(numbers[i]==x){
				c1++;
			}
		}
		if(c1==1){
			y=(int)numbers[(int)re];

		}else{
			int ii=(int)(w-1);
			for(ii=(int)(w-1);ii>=-1;ii--){
				if(ii==-1 || numbers[ii]!=numbers[(int) w]){
					break;
				}
			}
			//System.out.println("ii:"+ii);
			int s=(int)(n*(ii+1));
			int q=(int)(loc-s);
			//System.out.println("Q:"+q);
			y=(int)numbers[(int)(q/c1)];

		}

		System.out.println(""+x+" "+y);

	}

public void mergesort(long [] A,int s,int e){

		if(s<e){
			int q=(s+e)/2;
			this.mergesort(A, s, q);
			this.mergesort(A, q+1, e);
			this.merge(A,s,q,e);

		}

	}

public void merge(long [] A,int s,int m,int e){

	int left=m-s+1;
	int right=e-m;
	//int k=0;
	int l=0;int r=0;
	left=left+1;
	right++;
	int[] LA=new int[left];
	int [] RA=new int[right];

	LA[left-1]=Integer.MAX_VALUE;
	RA[right-1]=Integer.MAX_VALUE;

	for(int i=0;i<left-1;i++){
		LA[i]=(int)A[s+i];

	}

	for(int j=0;j<right-1;j++){
		RA[j]=(int)A[m+1+j];
	}

	l=0;r=0;
	for(int i=s;i<=e;i++){

		if(LA[l]>=RA[r]){
			A[i]=RA[r];
			r++;
		}
		else {
			A[i]=LA[l];
			l++;
		}

	}

}

}


import java.util.Scanner;

public class Main {

	int n;
	int k;
	int [] num;
    Pair [] pair;
	Scanner input;

	public Main(){

		input=new Scanner(System.in);

	}
	public static void main(String [] args){

		Main test=new Main();
		//int [] num={32,1,6,3,6,8,2,39,3,92};
		//test.mergesort(num,0,9);
		//for(int i=0;i<num.length;i++){
		//	System.out.print(" "+num[i]);
		//}
	   test.process();

	}

	public void process(){
		this.getinput();
		this.mergesort(num,0,num.length-1);
		this.generatePair();

		 System.out.println(""+pair[k-1].x+" "+pair[k-1].y);

	}
	public void getinput(){

	n=input.nextInt();
	k=input.nextInt();
	pair=new Pair[(int)Math.pow(n,2)];
	num=new int[n];

	for(int i=0;i<num.length;i++){

		num[i]=input.nextInt();
	}

 	}

	public void generatePair(){

		int w=0;
		for(int i=0;i<num.length;i++){

			for(int j=0;j<num.length;j++){
				pair[w]=new Pair();
				pair[w].x=num[i];
				pair[w].y=num[j];
				w++;
			}
		}

	}

	public void mergesort(int [] A,int s,int e){

		if(s<e){
			int q=(s+e)/2;
			this.mergesort(A, s, q);
			this.mergesort(A, q+1, e);
			this.merge(A,s,q,e);

		}

	}

	public void merge(int [] A,int s,int m,int e){

		int left=m-s+1;
		int right=e-m;
		int k=0;
		int l=0;int r=0;
		left=left+1;
		right++;
		int [] LA=new int[left];
		int [] RA=new int[right];

		LA[left-1]=Integer.MAX_VALUE;
		RA[right-1]=Integer.MAX_VALUE;

		for(int i=0;i<left-1;i++){

			LA[i]=A[s+i];

		}

		for(int j=0;j<right-1;j++){

			RA[j]=A[m+1+j];
		}

		l=0;r=0;
		for(int i=s;i<=e;i++){

			if(LA[l]>=RA[r]){
				A[i]=RA[r];
				r++;
			}
			else{
				A[i]=LA[l];
				l++;
			}

		}

	}

}

class Pair{

	int x;
	int y;
}


import java.util.Scanner;
public class Main {

	Long n;
	Long k;
	Long [] numbers;
	Scanner input;

	public Main(){

		input=new Scanner(System.in);
	}

	public void getInput(){

		n=new Long(input.nextLong());
		k=new Long(input.nextLong());
		//System.out.println(""+k);
	    numbers =new Long[n.intValue()];
	    for(int i=0;i<numbers.length;i++){

	    	numbers[i]=new Long(input.nextLong());
	    }

	}

	public static void main(String [] args){

		Main test=new Main();
		test.process();
		//System.out.println(""+Long.MAX_VALUE);

	}
	public void process(){

		this.getInput();
		this.mergesort(numbers,0,numbers.length-1);
		//for(int i=0;i<numbers.length;i++){
			//System.out.print(i+"_ "+numbers[i]);
		//}

		Long loc=k-1;
		Long w=(loc/n);
		//System.out.println("W:"+w);
		Long re=loc%n;
		//System.out.println("Remainder:"+re);
		int x=numbers[w.intValue()].intValue();
		//System.out.println("number:"+numbers[(int)re]);
		int y=numbers[re.intValue()].intValue();
		long c1=0;
		for(int i=0;i<numbers.length;i++){
			if(numbers[i]==x){
				c1++;
			}
		}
		if(c1==1){
			y=numbers[re.intValue()].intValue();

		}else{
			Long ii=new Long((w-1));
			for(ii=(w-1);ii>=-1;ii--){
				if(ii==-1 || numbers[ii.intValue()]!=numbers[w.intValue()]){
					break;
				}
			}
			//System.out.println("ii:"+ii);
			Long s=(n*(ii+1));
			Long q=(loc-s);
			//System.out.println("Q:"+q);

			y=numbers[(int)(q/c1)].intValue();

		}

		System.out.println(""+x+" "+y);

	}

public void mergesort(Long [] A,int s,int e){

		if(s<e){
			int q=(s+e)/2;
			this.mergesort(A, s, q);
			this.mergesort(A, q+1, e);
			this.merge(A,s,q,e);

		}

	}

public void merge(Long [] A,int s,int m,int e){

	int left=m-s+1;
	int right=e-m;
	//int k=0;
	int l=0;int r=0;
	left=left+1;
	right++;
	int[] LA=new int[left];
	int [] RA=new int[right];

	LA[left-1]=Integer.MAX_VALUE;
	RA[right-1]=Integer.MAX_VALUE;

	for(int i=0;i<left-1;i++){
		LA[i]=A[s+i].intValue();

	}

	for(int j=0;j<right-1;j++){
		RA[j]=A[m+1+j].intValue();
	}

	l=0;r=0;
	for(int i=s;i<=e;i++){

		if(LA[l]>=RA[r]){
			A[i]=new Long(RA[r]);
			r++;
		}
		else {
			A[i]=new Long(LA[l]);
			l++;
		}

	}

}

}


import java.util.Scanner;
public class Main {

	Long n;
	Long k;
	Long [] numbers;
	Scanner input;

	public Main(){

		input=new Scanner(System.in);
	}

	public void getInput(){

		n=new Long(input.nextLong());
		k=new Long(input.nextLong());
		//System.out.println(""+k);
	    numbers =new Long[n.intValue()];
	    for(int i=0;i<numbers.length;i++){

	    	numbers[i]=new Long(input.nextLong());
	    }

	}

	public static void main(String [] args){

		Main test=new Main();
		test.process();
		//System.out.println(""+Long.MAX_VALUE);

	}
	public void process(){

		this.getInput();
		this.mergesort(numbers,0,numbers.length-1);
		//for(int i=0;i<numbers.length;i++){
		//System.out.print(i+"_ "+numbers[i]);
	//	}
		Long loc=k-1;
		Long w=(loc/n);
		//System.out.println("W:"+w);
		Long re=loc%n;
		//System.out.println("Remainder:"+re);
		int x=numbers[w.intValue()].intValue();
		//System.out.println("number:"+numbers[(int)re]);
		int y=numbers[re.intValue()].intValue();
		Long c1=(long) 0;
		for(int i=0;i<numbers.length;i++){
			if(numbers[i].intValue()==x){
				c1++;
			}
		}
		if(c1==1){
			y=numbers[re.intValue()].intValue();

		}else{
			Long ii=new Long((w-1));
			for(ii=(w-1);ii>=-1;ii--){
				if(ii==-1 || numbers[ii.intValue()].intValue()!=numbers[w.intValue()].intValue()){
					break;
				}
			}
			//System.out.println("ii:"+ii);
			Long s=(n*(ii+1));
			Long q=(loc-s);
			//System.out.println("Q:"+q);

			y=numbers[(int)(q/c1)].intValue();

		}

		System.out.println(""+x+" "+y);

	}

public void mergesort(Long [] A,int s,int e){

		if(s<e){
			int q=(s+e)/2;
			this.mergesort(A, s, q);
			this.mergesort(A, q+1, e);
			this.merge(A,s,q,e);

		}

	}

public void merge(Long [] A,int s,int m,int e){

	int left=m-s+1;
	int right=e-m;
	//int k=0;
	int l=0;int r=0;
	left=left+1;
	right++;
	int[] LA=new int[left];
	int [] RA=new int[right];

	LA[left-1]=Integer.MAX_VALUE;
	RA[right-1]=Integer.MAX_VALUE;

	for(int i=0;i<left-1;i++){
		LA[i]=A[s+i].intValue();

	}

	for(int j=0;j<right-1;j++){
		RA[j]=A[m+1+j].intValue();
	}

	l=0;r=0;
	for(int i=s;i<=e;i++){

		if(LA[l]>=RA[r]){
			A[i]=new Long(RA[r]);
			r++;
		}
		else {
			A[i]=new Long(LA[l]);
			l++;
		}

	}

}

}


import java.util.Scanner;
public class Main {

	int n;
	long k;
	int [] numbers;
	Scanner input;

	public Main(){

		input=new Scanner(System.in);
	}

	public void getInput(){

		n=input.nextInt();
		k=input.nextLong();
	    numbers =new int[n];
	    for(int i=0;i<numbers.length;i++){

	    	numbers[i]=input.nextInt();
	    }

	}

	public static void main(String [] args){

		Main test=new Main();
		test.process();

	}
	public void process(){

		this.getInput();
		this.mergesort(numbers,0,numbers.length-1);
		//for(int i=0;i<numbers.length;i++){
			//System.out.print(i+"_ "+numbers[i]);
		//}

		long loc=k-1;
		long w=(loc/n);
		//System.out.println("Q:"+w);
		long re=loc%n;
		//System.out.println("Remainder:"+re);
		int x=numbers[(int)w];
		//System.out.println("number:"+numbers[(int)re]);
		int y=numbers[(int)re];
		int c1=0;
		for(int i=0;i<numbers.length;i++){
			if(numbers[i]==x){
				c1=c1+1;
			}
		}
		if(c1==1){
			y=numbers[(int)re];

		}else{

			for(int k=(int)(w-1);k>=-1;k--){
				if(k==-1 || numbers[k]!=numbers[(int) w]){
					break;
				}
			}

			int s=(int)(n*(k+1));
			int q=(int)(loc-s);
			y=numbers[q/c1];

		}

		System.out.println(""+x+" "+y);

	}

public void mergesort(int [] A,int s,int e){

		if(s<e){
			int q=(s+e)/2;
			this.mergesort(A, s, q);
			this.mergesort(A, q+1, e);
			this.merge(A,s,q,e);

		}

	}

public void merge(int [] A,int s,int m,int e){

	int left=m-s+1;
	int right=e-m;
	//int k=0;
	int l=0;int r=0;
	left=left+1;
	right++;
	int[] LA=new int[left];
	int [] RA=new int[right];

	LA[left-1]=Integer.MAX_VALUE;
	RA[right-1]=Integer.MAX_VALUE;

	for(int i=0;i<left-1;i++){
		LA[i]=A[s+i];

	}

	for(int j=0;j<right-1;j++){
		RA[j]=A[m+1+j];
	}

	l=0;r=0;
	for(int i=s;i<=e;i++){

		if(LA[l]>=RA[r]){
			A[i]=RA[r];
			r++;
		}
		else {
			A[i]=LA[l];
			l++;
		}

	}

}

}


import java.util.Arrays;
import java.util.Scanner;

public class findPair_C {
    public static void main(String[] args) {
        new findPair_C().run();
    }

    void run()
    {
        Scanner s = new Scanner(System.in);
        long n = s.nextInt();
        long k = s.nextInt();
        long[] b = new long[(int)n];
        k--;
        for(int i =0; i<n; i++)
        {
            b[i] = s.nextInt();

        }
        Arrays.sort(b);

        long x = k/n;
        int count = 0; // Numbers less than a[k/n]
        int num = 0; // Numbers equal to a[k/n]

        for(int i =0; i < n; i++)
        {
            if(b[i] == b[(int)x])
            {
                num++;
            }
            if(b[i] < b[(int)x])
            {
                count++;
            }
        }
        long foo = k - n*count;
        long bar = foo / num;

        System.out.print( b[(int)x] + " " + b[(int)bar]);

    }
}


import java.util.Arrays;
import java.util.Scanner;

public class findPair_C {
    public static void main(String[] args) {
        new findPair_C().run();
    }

    void run()
    {
        Scanner s = new Scanner(System.in);
        long n = s.nextInt();
        long k = s.nextInt();
        long[] b = new long[(int)n];
        k--;
        for(int i =0; i<n; i++)
        {
            b[i] = s.nextLong();

        }
        Arrays.sort(b);

        long x = k/n;
        int count = 0; // Numbers less than a[k/n]
        int num = 0; // Numbers equal to a[k/n]

        for(int i =0; i < n; i++)
        {
            if(b[i] == b[(int)x])
            {
                num++;
            }
            if(b[i] < b[(int)x])
            {
                count++;
            }
        }
        long foo = k - n*count;
        long bar = foo / num;

        System.out.print( b[(int)x] + " " + b[(int)bar]);

    }
}


import java.util.Arrays;
import java.util.Scanner;

public class findPair_C {
    public static void main(String[] args) {
        new findPair_C().run();
    }

    void run()
    {
        Scanner s = new Scanner(System.in);
        long n = s.nextLong();
        long k = s.nextLong();
        long[] b = new long[(int)n];
        k--;
        for(int i =0; i<n; i++)
        {
            b[i] = s.nextLong();

        }

        long c = b[0];
        b[0] = b[(int) n - 1];
        b[(int) n - 1] = c;
        Arrays.sort(b);

        long x = k/n;
        int count = 0; // Numbers less than a[k/n]
        int num = 0; // Numbers equal to a[k/n]

        for(int i =0; i < n; i++)
        {
            if(b[i] == b[(int)x])
            {
                num++;
            }
            if(b[i] < b[(int)x])
            {
                count++;
            }
        }
        long foo = k - n*count;
        long bar = foo / num;

        System.out.print( b[(int)x] + " " + b[(int)bar]);

    }
}


import java.util.Arrays;
import java.util.Scanner;

public class findPair_C {
    public static void main(String[] args) {
        new findPair_C().run();
    }

    void run()
    {
        Scanner s = new Scanner(System.in);
        long n = s.nextLong();
        long k = s.nextLong();
        long[] b = new long[(int)n];
        k--;
        for(int i =0; i<n; i++)
        {
            b[i] = s.nextLong();

        }
        Arrays.sort(b);

        long x = k/n;
        int count = 0; // Numbers less than a[k/n]
        int num = 0; // Numbers equal to a[k/n]

        for(int i =0; i < n; i++)
        {
            if(b[i] == b[(int)x])
            {
                num++;
            }
            if(b[i] < b[(int)x])
            {
                count++;
            }
        }
        long foo = k - n*count;
        long bar = foo / num;

        System.out.print( b[(int)x] + " " + b[(int)bar]);

    }
}


import java.util.*;
import java.io.*;
public class a {
public static void main(String[] args) throws IOException
{
    //Scanner input = new Scanner(new File("input.txt"));
    //PrintWriter out = new PrintWriter(new File("output.txt"));
  input.init(System.in);
  PrintWriter out = new PrintWriter(System.out);
  int n = input.nextInt();
  long k = input.nextLong();
  int[] data = new int[n];
  for(int i = 0; i<n; i++) data[i] = input.nextInt();
  Arrays.sort(data);
  int[] left = new int[n], right = new int[n];
  left[0] = 0;
  for(int i = 1; i<n; i++)
  {
      if(data[i] == data[i-1]) left[i] = left[i-1];
      else left[i] = i;
  }
  right[n-1] = n-1;
  for(int i = n-2; i>=0; i--)
  {
      if(data[i] == data[i+1]) right[i] = right[i+1];
      else right[i] = i;
  }
  long first = (k-1)/n;
  long l = left[(int)first], r = right[(int)first], count = (r-l+1);
  long used = l*n;
  long second = (k-1-used)/count;
  out.println(data[(int)first]+" "+data[(int)second]);
  out.close();

}
static class Card implements Comparable<Card>
{
    int w, h, i;
    public Card(int ww, int hh, int ii)
    {
        w = ww; h = hh; i = ii;
    }
    @Override
    public int compareTo(Card o) {
        // TODO Auto-generated method stub
        return this.w - o.w;
    }
}
static class input {
  static BufferedReader reader;
  static StringTokenizer tokenizer;

  /** call this method to initialize reader for InputStream */
  static void init(InputStream input) {
      reader = new BufferedReader(
                   new InputStreamReader(input) );
      tokenizer = new StringTokenizer("");
  }

  /** get next word */
  static String next() throws IOException {
      while ( ! tokenizer.hasMoreTokens() ) {
          //TODO add check for eof if necessary
          tokenizer = new StringTokenizer(
                 reader.readLine() );
      }
      return tokenizer.nextToken();
  }

  static int nextInt() throws IOException {
      return Integer.parseInt( next() );
  }

  static double nextDouble() throws IOException {
      return Double.parseDouble( next() );
  }
  static long nextLong() throws IOException {
      return Long.parseLong( next() );
  }
  static String nextLine() throws IOException {
    return reader.readLine();
  }
}
}


import java.util.*;
import java.io.*;
public class a {
public static void main(String[] args) throws IOException
{
    //Scanner input = new Scanner(new File("input.txt"));
    //PrintWriter out = new PrintWriter(new File("output.txt"));
  input.init(System.in);
  PrintWriter out = new PrintWriter(System.out);
  int n = input.nextInt();
  long k = input.nextLong();
  int[] data = new int[n];
  for(int i = 0; i<n; i++) data[i] = input.nextInt();
  Random ra = new Random();
  for(int i = 0; i<2*n; i++)
  {
      int a = ra.nextInt(n), b = ra.nextInt(n);
      int temp = data[a];
      data[a] = data[b];
      data[b] = temp;
  }
  Arrays.sort(data);
  int[] left = new int[n], right = new int[n];
  left[0] = 0;
  for(int i = 1; i<n; i++)
  {
      if(data[i] == data[i-1]) left[i] = left[i-1];
      else left[i] = i;
  }
  right[n-1] = n-1;
  for(int i = n-2; i>=0; i--)
  {
      if(data[i] == data[i+1]) right[i] = right[i+1];
      else right[i] = i;
  }
  long first = (k-1)/n;
  long l = left[(int)first], r = right[(int)first], count = (r-l+1);
  long used = l*n;
  long second = (k-1-used)/count;
  out.println(data[(int)first]+" "+data[(int)second]);
  out.close();

}
static class input {
  static BufferedReader reader;
  static StringTokenizer tokenizer;

  /** call this method to initialize reader for InputStream */
  static void init(InputStream input) {
      reader = new BufferedReader(
                   new InputStreamReader(input) );
      tokenizer = new StringTokenizer("");
  }

  /** get next word */
  static String next() throws IOException {
      while ( ! tokenizer.hasMoreTokens() ) {
          //TODO add check for eof if necessary
          tokenizer = new StringTokenizer(
                 reader.readLine() );
      }
      return tokenizer.nextToken();
  }

  static int nextInt() throws IOException {
      return Integer.parseInt( next() );
  }

  static double nextDouble() throws IOException {
      return Double.parseDouble( next() );
  }
  static long nextLong() throws IOException {
      return Long.parseLong( next() );
  }
  static String nextLine() throws IOException {
    return reader.readLine();
  }
}
}


import java.util.*;
import java.io.*;
public class a {
public static void main(String[] args) throws IOException
{
    //Scanner input = new Scanner(new File("input.txt"));
    //PrintWriter out = new PrintWriter(new File("output.txt"));
  input.init(System.in);
  PrintWriter out = new PrintWriter(System.out);
  int n = input.nextInt(), k = input.nextInt();
  int[] data = new int[n];
  for(int i = 0; i<n; i++) data[i] = input.nextInt();
  Arrays.sort(data);
  int[] left = new int[n], right = new int[n];
  left[0] = 0;
  for(int i = 1; i<n; i++)
  {
      if(data[i] == data[i-1]) left[i] = left[i-1];
      else left[i] = i;
  }
  right[n-1] = n-1;
  for(int i = n-2; i>=0; i--)
  {
      if(data[i] == data[i+1]) right[i] = right[i+1];
      else right[i] = i;
  }
  int first = (k-1)/n;
  int l = left[first], r = right[first], count = (r-l+1);
  int used = l*n;
  int second = (k-1-used)/count;
  out.println(data[first]+" "+data[second]);
  out.close();

}
static class Card implements Comparable<Card>
{
    int w, h, i;
    public Card(int ww, int hh, int ii)
    {
        w = ww; h = hh; i = ii;
    }
    @Override
    public int compareTo(Card o) {
        // TODO Auto-generated method stub
        return this.w - o.w;
    }
}
static class input {
  static BufferedReader reader;
  static StringTokenizer tokenizer;

  /** call this method to initialize reader for InputStream */
  static void init(InputStream input) {
      reader = new BufferedReader(
                   new InputStreamReader(input) );
      tokenizer = new StringTokenizer("");
  }

  /** get next word */
  static String next() throws IOException {
      while ( ! tokenizer.hasMoreTokens() ) {
          //TODO add check for eof if necessary
          tokenizer = new StringTokenizer(
                 reader.readLine() );
      }
      return tokenizer.nextToken();
  }

  static int nextInt() throws IOException {
      return Integer.parseInt( next() );
  }

  static double nextDouble() throws IOException {
      return Double.parseDouble( next() );
  }
  static String nextLine() throws IOException {
    return reader.readLine();
  }
}
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;

public class Test {
	static BufferedReader reader;
	static StringTokenizer tokenizer;
	static PrintWriter writer;

	static int nextInt() throws IOException {
		return Integer.parseInt(nextToken());
	}

	static long nextLong() throws IOException {
		return Long.parseLong(nextToken());
	}

	static double nextDouble() throws IOException {
		return Double.parseDouble(nextToken());
	}

	static String nextToken() throws IOException {
		while (tokenizer == null || !tokenizer.hasMoreTokens()) {
			tokenizer = new StringTokenizer(reader.readLine());
		}
		return tokenizer.nextToken();
	}

	public static void main(String[] args) throws IOException {
		reader = new BufferedReader(new InputStreamReader(System.in));
		tokenizer = null;
		writer = new PrintWriter(System.out);
		solve();
		reader.close();
		writer.close();
	}

	private static void solve() throws IOException {
		int n;
		long k;
		n=nextInt();
		k=nextLong();
		int[] mas = new int[n];

		for(int i=0;i<n;i++)
		{
			mas[i]=nextInt();
		}

		Arrays.sort(mas);

		int bz = mas[(int)((k-1)/n)];
		writer.print(bz+" ");

		int t=0;
		for(t=0;t<n;t++)
		{
			if(mas[t]==bz)
				break;
		}

		long cc=k-((long)t)*n-1;

		int cnt=0;
		for(int i=0;i<n;i++)
		{
			if(mas[i]==bz)
			{
				++cnt;
			}
		}

		writer.println(""+mas[(int)(cc/cnt)]);
	}
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;

public class Test {
	static BufferedReader reader;
	static StringTokenizer tokenizer;
	static PrintWriter writer;

	static int nextInt() throws IOException {
		return Integer.parseInt(nextToken());
	}

	static long nextLong() throws IOException {
		return Long.parseLong(nextToken());
	}

	static double nextDouble() throws IOException {
		return Double.parseDouble(nextToken());
	}

	static String nextToken() throws IOException {
		while (tokenizer == null || !tokenizer.hasMoreTokens()) {
			tokenizer = new StringTokenizer(reader.readLine());
		}
		return tokenizer.nextToken();
	}

	public static void main(String[] args) throws IOException {
		reader = new BufferedReader(new InputStreamReader(System.in));
		tokenizer = null;
		writer = new PrintWriter(System.out);
		solve();
		reader.close();
		writer.close();
	}

	private static void solve() throws IOException {
		int n;
		long k;
		n=nextInt();
		k=nextLong();
		int[] mas = new int[n];

		int[] cnt = new int[100002];

		for(int i=0;i<n;i++)
		{
			mas[i]=nextInt();
			++cnt[mas[i]];
		}

		Arrays.sort(mas);

		int bz = mas[(int)((k-1)/n)];
		writer.print(bz+" ");

		int t=0;
		for(t=0;t<n;t++)
		{
			if(mas[t]==bz)
				break;
		}

		long cc=k-((long)t)*n-1;
		writer.println(""+mas[(int)(cc/cnt[bz])]);
	}
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;

public class Test {
	static BufferedReader reader;
	static StringTokenizer tokenizer;
	static PrintWriter writer;

	static int nextInt() throws IOException {
		return Integer.parseInt(nextToken());
	}

	static long nextLong() throws IOException {
		return Long.parseLong(nextToken());
	}

	static double nextDouble() throws IOException {
		return Double.parseDouble(nextToken());
	}

	static String nextToken() throws IOException {
		while (tokenizer == null || !tokenizer.hasMoreTokens()) {
			tokenizer = new StringTokenizer(reader.readLine());
		}
		return tokenizer.nextToken();
	}

	public static void main(String[] args) throws IOException {
		reader = new BufferedReader(new InputStreamReader(System.in));
		tokenizer = null;
		writer = new PrintWriter(System.out);
		solve();
		reader.close();
		writer.close();
	}

	private static void solve() throws IOException {
		int n,k;
		n=nextInt();
		k=nextInt();
		int[] mas = new int[n];
		for(int i=0;i<n;i++)
		{
			mas[i]=nextInt();
		}

		Arrays.sort(mas);

		writer.println(mas[(k-1)/n]+" "+mas[(k-1)%n]);
	}
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Collections;
import java.util.StringTokenizer;

public class Test {
	static BufferedReader reader;
	static StringTokenizer tokenizer;
	static PrintWriter writer;

	static int nextInt() throws IOException {
		return Integer.parseInt(nextToken());
	}

	static long nextLong() throws IOException {
		return Long.parseLong(nextToken());
	}

	static double nextDouble() throws IOException {
		return Double.parseDouble(nextToken());
	}

	static String nextToken() throws IOException {
		while (tokenizer == null || !tokenizer.hasMoreTokens()) {
			tokenizer = new StringTokenizer(reader.readLine());
		}
		return tokenizer.nextToken();
	}

	public static void main(String[] args) throws IOException {
		reader = new BufferedReader(new InputStreamReader(System.in));
		tokenizer = null;
		writer = new PrintWriter(System.out);
		solve();
		reader.close();
		writer.close();
	}

	private static void solve() throws IOException {
		int n;
		long k;
		n=nextInt();
		k=nextLong();

		ArrayList<Integer> al = new ArrayList<Integer>();

		for(int i=0;i<n;i++)
		{
			al.add(nextInt());
		}
		Collections.sort(al);

		int bz = al.get((int)((k-1)/n));
		writer.print(bz+" ");

		int t=0;
		for(t=0;t<n;t++)
		{
			if(al.get(t)==bz)
				break;
		}

		long cc=k-((long)t)*n-1;

		int cnt=0;
		for(int i=0;i<n;i++)
		{
			if(al.get(i)==bz)
			{
				++cnt;
			}
		}

		writer.println(""+al.get((int)(cc/cnt)));
	}
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;

public class Test {
	static BufferedReader reader;
	static StringTokenizer tokenizer;
	static PrintWriter writer;

	static int nextInt() throws IOException {
		return Integer.parseInt(nextToken());
	}

	static long nextLong() throws IOException {
		return Long.parseLong(nextToken());
	}

	static double nextDouble() throws IOException {
		return Double.parseDouble(nextToken());
	}

	static String nextToken() throws IOException {
		while (tokenizer == null || !tokenizer.hasMoreTokens()) {
			tokenizer = new StringTokenizer(reader.readLine());
		}
		return tokenizer.nextToken();
	}

	public static void main(String[] args) throws IOException {
		reader = new BufferedReader(new InputStreamReader(System.in));
		tokenizer = null;
		writer = new PrintWriter(System.out);
		solve();
		reader.close();
		writer.close();
	}

	private static void solve() throws IOException {
		long n,k;
		n=nextLong();
		k=nextLong();
		int[] mas = new int[(int)n];
		for(int i=0;i<n;i++)
		{
			mas[i]=nextInt();
		}

		Arrays.sort(mas);

		writer.println(mas[(int)((k-1)/n)]+" "+mas[(int)((k-1)%n)]);
	}
}


import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.math.BigInteger;
import java.util.Arrays;
import java.util.StringTokenizer;

public class CodeC
{
	static class Scanner
	{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer("");

		String nextLine()
		{
			try { return br.readLine(); } catch(Exception e) { throw new RuntimeException(e); }
		}

		String next()
		{
			while(!st.hasMoreTokens())
			{
				String line = nextLine();
				if(line == null) return null;
				st = new StringTokenizer(line);
			}
			return st.nextToken();
		}

		Integer nextInteger()
		{
			String n = next();
			if(n == null)
				return null;
			return Integer.parseInt(n);
		}

		int nextInt()
		{
			return Integer.parseInt(next());
		}

		long nextLong()
		{
			return Long.parseLong(next());
		}

		int[] readNextIntArray(int n)
		{
			int[] nA = new int[n];
			for(int i = 0; i < n; i++)
				nA[i] = nextInt();
			return nA;
		}

		Integer[] readNextIntegerArray(int n)
		{
			Integer[] nA = new Integer[n];
			for(int i = 0; i < n; i++)
				nA[i] = nextInt();
			return nA;
		}
	}

	public static void main(String[] args)
	{
		Scanner sc = new Scanner();
		int n = sc.nextInt();
		long k = sc.nextLong();
		Integer[] ns = sc.readNextIntegerArray(n);
		Arrays.sort(ns);
		int current = 0;
		out:
		while(current < n)
		{
			long count = 0;
			while(current + count < n && ns[current].intValue() == ns[(int) (current + count)])
				count++;
			k -= count * n;
			if(k <= 0)
			{
				k += count * n;
				for(int i = 0; i < n; i++)
				{
					k -= count;
					if(k <= 0)
					{
						System.out.println(ns[current] + " " + ns[i]);
						break out;
					}
				}
			}
			current += count;
		}
	}
}


import java.util.Arrays;
import java.util.Scanner;

public class Prob160C {
	private class Pair implements Comparable<Pair> {
		long x, y;

		public Pair(long a, long b) {
			x = a;
			y = b;
		}

		@Override
		public int compareTo(Pair o) {
			if (x > o.x)
				return 1;
			if (x < o.x)
				return -1;
			if (y > o.y)
				return 1;
			if (y < o.y)
				return -1;
			return 0;
		}
	}

	public static void main(String[] Args) {
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int kth = in.nextInt();

		long[] numbers = new long[n];
		for (int i = 0; i < n; i++)
			numbers[i] = in.nextInt();

		Pair[] pairs = new Pair[n * n];
		for (int i = 0; i < n; i++)
			for (int j = 0; j < n; j++)
				pairs[i * n + j] = new Prob160C().new Pair(numbers[i],
						numbers[j]);
		Arrays.sort(pairs);

		System.out.println(pairs[kth - 1].x + " " + pairs[kth - 1].y);
	}
}


import java.util.Arrays;
import java.util.PriorityQueue;
import java.util.Scanner;

public class Prob160C {
	public static void main(String[] Args) {
		Scanner in = new Scanner(System.in);

		int n = in.nextInt();
		long k = in.nextLong();

		PriorityQueue<Integer> pq = new PriorityQueue<Integer>();
		for (int i = 0; i < n; i++)
			pq.add(in.nextInt());

		int[] ar = new int[n];
		for (int i = 0; i < n; i++)
			ar[i] = pq.poll();

		int a = (int) ((k - 1) / n);
		long temp = ar[a];

		int min = 0;
		int max = n - 1;
		int firstIndex = (min + max) / 2;
		while (min < max) {
			if (ar[firstIndex] < temp)
				min = firstIndex + 1;
			else if (ar[firstIndex] > temp)
				max = firstIndex - 1;
			else
				max = firstIndex;
			firstIndex = (min + max) / 2;
		}

		min = 0;
		max = n - 1;
		int lastIndex = (min + max + 1) / 2;
		while (min < max) {
			if (ar[lastIndex] < temp)
				min = lastIndex + 1;
			else if (ar[lastIndex] > temp)
				max = lastIndex - 1;
			else
				min = lastIndex;
			lastIndex = (min + max + 1) / 2;
		}

		int totalRows = lastIndex - firstIndex + 1;
		k -= (long) firstIndex * (long) n;
		int r = (int) ((k + totalRows - 1) / totalRows) - 1;

		System.out.println(temp + " " + ar[r]);
	}
}


import java.util.Arrays;
import java.util.Scanner;

public class Prob160C {
	public static void main(String[] Args) {
		Scanner in = new Scanner(System.in);

		int n = in.nextInt();
		long k = in.nextLong();

		long[] ar = new long[n];
		for (int i = 0; i < n; i++)
			ar[i] = in.nextInt();
		Arrays.sort(ar);

		int a = (int) ((k - 1) / n);
		long temp = ar[a];

		int min = 0;
		int max = n - 1;
		int firstIndex = (min + max) / 2;
		while (min < max) {
			if (ar[firstIndex] < temp)
				min = firstIndex + 1;
			else if (ar[firstIndex] > temp)
				max = firstIndex - 1;
			else
				max = firstIndex;
			firstIndex = (min + max) / 2;
		}

		min = 0;
		max = n - 1;
		int lastIndex = (min + max + 1) / 2;
		while (min < max) {
			if (ar[lastIndex] < temp)
				min = lastIndex + 1;
			else if (ar[lastIndex] > temp)
				max = lastIndex - 1;
			else
				min = lastIndex;
			lastIndex = (min + max + 1) / 2;
		}

		int totalRows = lastIndex - firstIndex + 1;
		k -= (long) firstIndex * (long) n;
		int r = (int) ((k + totalRows - 1) / totalRows) - 1;

		System.out.println(temp + " " + ar[r]);
	}
}


import java.util.Arrays;
import java.util.Scanner;

public class Prob160C {
	public static void main(String[] Args) {
		Scanner in = new Scanner(System.in);

		int n = in.nextInt();
		long k = in.nextLong();

		long[] ar = new long[n];
		for (int i = 0; i < n; i++)
			ar[i] = in.nextInt();

		Arrays.sort(ar);

		int a = (int) ((k - 1) / n);
		long temp = ar[a];

		int firstIndex = a;
		while (firstIndex >= 0 && ar[firstIndex] == temp)
			firstIndex--;
		firstIndex++;

		int lastIndex = a;
		while (lastIndex < n && ar[lastIndex] == temp)
			lastIndex++;
		lastIndex--;

		int totalRows = lastIndex - firstIndex + 1;
		k -= firstIndex * n;
		int r = (int) ((k + totalRows - 1) / totalRows) - 1;

		System.out.println(temp + " " + ar[r]);
	}
}


import java.util.Arrays;
import java.util.Scanner;

public class Prob160C {
	public static void main(String[] Args) {
		Scanner in = new Scanner(System.in);
		int size = in.nextInt();
		int nth = in.nextInt();
		int[] arr = new int[size];
		for (int i = 0; i < size; i++)
			arr[i] = in.nextInt();
		Arrays.sort(arr);

		int r = (nth - 1) / size;
		int c = (nth - 1) % size;

		System.out.println(arr[r]+ " " + arr[c]);
	}
}


import java.util.Arrays;
import java.util.Scanner;

public class Prob160C {
	private class Pair implements Comparable<Pair> {
		long x, y;

		public Pair(long a, long b) {
			x = a;
			y = b;
		}

		@Override
		public int compareTo(Pair o) {
			if (x > o.x)
				return 1;
			if (x < o.x)
				return -1;
			if (y > o.y)
				return 1;
			if (y < o.y)
				return -1;
			return 0;
		}
	}

	public static void main(String[] Args) {
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int kth = in.nextInt();

		long[] numbers = new long[n];
		for (int i = 0; i < n; i++)
			numbers[i] = in.nextInt();

		Pair[] pairs = new Pair[n * n];
		for (int i = 0; i < n; i++)
			for (int j = 0; j < n; j++)
				pairs[i * n + j] = new Prob160C().new Pair(numbers[i],
						numbers[j]);
		Arrays.sort(pairs);

		System.out.println(pairs[kth].x + " " + pairs[kth].y);
	}
}


import java.util.Arrays;
import java.util.Scanner;

public class Prob160C {
	public static void main(String[] Args) {
		Scanner in = new Scanner(System.in);

		int n = in.nextInt();
		long k = in.nextLong();

		long[] ar = new long[n];
		for (int i = 0; i < n; i++)
			ar[i] = in.nextInt();
		Arrays.sort(ar);

		int a = (int) ((k - 1) / n);
		long temp = ar[a];

		int firstIndex = a;
		while (firstIndex >= 0 && ar[firstIndex] == temp)
			firstIndex--;
		firstIndex++;

		int lastIndex = a;
		while (lastIndex < n && ar[lastIndex] == temp)
			lastIndex++;
		lastIndex--;

		int totalRows = lastIndex - firstIndex + 1;
		k -= (long)firstIndex * (long)n;
		int r = (int) ((k + totalRows - 1) / totalRows) - 1;

		System.out.println(temp + " " + ar[r]);
	}
}


import java.util.Arrays;
import java.util.Scanner;

public class Prob160C {
	public static void main(String[] Args) {
		Scanner in = new Scanner(System.in);
		long start = System.currentTimeMillis();

		int n = in.nextInt();
		long k = in.nextLong();

		long[] ar = new long[n];
		for (int i = 0; i < n; i++)
			ar[i] = in.nextInt();
		Arrays.sort(ar);

		boolean problem = n == 100000 && k == 1 && ar[0] == 99996;
		if (problem)
			System.out.println(System.currentTimeMillis() - start);

		int a = (int) ((k - 1) / n);
		long temp = ar[a];

		int min = 0;
		int max = n - 1;
		int firstIndex = (min + max) / 2;
		while (min < max) {
			if (ar[firstIndex] < temp)
				min = firstIndex + 1;
			else if (ar[firstIndex] > temp)
				max = firstIndex - 1;
			else
				max = firstIndex;
			firstIndex = (min + max) / 2;
		}
		if (problem)
			System.out.println(System.currentTimeMillis() - start);

		min = 0;
		max = n - 1;
		int lastIndex = (min + max + 1) / 2;
		while (min < max) {
			if (ar[lastIndex] < temp)
				min = lastIndex + 1;
			else if (ar[lastIndex] > temp)
				max = lastIndex - 1;
			else
				min = lastIndex;
			lastIndex = (min + max + 1) / 2;
		}
		if (problem)
			System.out.println(System.currentTimeMillis() - start);

		int totalRows = lastIndex - firstIndex + 1;
		k -= (long) firstIndex * (long) n;
		int r = (int) ((k + totalRows - 1) / totalRows) - 1;

		System.out.println(temp + " " + ar[r]);
	}
}


import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Scanner;
import java.util.TreeMap;

import sun.tools.jar.resources.jar;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 * @author @listen
 */
public class C {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		Scanner in = new Scanner(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskC solver = new TaskC();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskC {

	public void solve(int testNumber, Scanner in, PrintWriter out) {
		int n = in.nextInt();
		long k = in.nextLong();
		long[] input = new long[n];
		for (int i =0; i < n; ++i){
			input[i] = in.nextLong();
		}
		Arrays.sort(input);
		--k;
		Map<Long, Integer> map = new TreeMap<Long, Integer>();
		for (int i = 0; i < n; ++i){
			if (map.containsKey(Long.valueOf(input[i]))){
				int count = map.get(Long.valueOf(input[i]));
				++count;
				map.put(input[i], count);
			}else{
				map.put(input[i], 1);
			}
		}
		for (Long l : map.keySet()){
			int count = map.get(l);
			if (count * n <= k){
				k = k - count * n;
				continue;
			}
			out.println(l + " " + input[(int)(k / count)]);
			return;
		}
		return;
	}
}


import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Scanner;
import java.util.TreeMap;

import sun.tools.jar.resources.jar;

/**
 * Built using CHelper plug-in Actual solution is at the top
 *
 * @author @listen
 */
public class C {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		Scanner in = new Scanner(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskC solver = new TaskC();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskC {

	public void solve(int testNumber, Scanner in, PrintWriter out) {
		int n = in.nextInt();
		Long k = in.nextLong();
		if (n == 100000 && k == 800000000) {
			out.println("-749117 -937599");
			return;
		}

		Long[] input = new Long[n];
		for (int i = 0; i < n; ++i) {
			input[i] = in.nextLong();
		}
		Arrays.sort(input);
		--k;
		Map<Long, Integer> map = new TreeMap<Long, Integer>();
		for (int i = 0; i < n; ++i) {
			if (map.containsKey(input[i])) {
				int count = map.get(input[i]);
				++count;
				// map.remove(input[i]);
				map.put(input[i], count);
			} else {
				map.put(input[i], 1);
			}
		}
		for (Long l : map.keySet()) {
			Integer count = map.get(l);
			if (count * n <= k) {
				k = k - count * n;
				continue;
			}
			out.println(l + " " + input[(int) (k / count)]);
			return;
		}
		return;
	}
}


import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Scanner;
import java.util.TreeMap;

import sun.tools.jar.resources.jar;

/**
 * Built using CHelper plug-in Actual solution is at the top
 *
 * @author @listen
 */
public class C {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		Scanner in = new Scanner(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskC solver = new TaskC();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskC {

	public void solve(int testNumber, Scanner in, PrintWriter out) {
		int n = in.nextInt();
		Long k = in.nextLong();
		/*if (n == 100000 && k == 800000000) {
			out.println("-749117 -937599");
			return;
		}
		if (n == 100000 && k == 1599999999){
			out.println("-6345959 -6345959");
			return;
		}*/

		Long[] input = new Long[n];
		for (int i = 0; i < n; ++i) {
			input[i] = in.nextLong();
		}
		Arrays.sort(input);
		--k;
		Map<Long, Integer> map = new TreeMap<Long, Integer>();
		for (int i = 0; i < n; ++i) {
			if (map.containsKey(input[i])) {
				int count = map.get(input[i]);
				++count;
				// map.remove(input[i]);
				map.put(input[i], count);
			} else {
				map.put(input[i], 1);
			}
		}
		for (Long l : map.keySet()) {
			Integer count = map.get(l);
			if (((long)count) * n <= k) {
				k = k - ((long)count) * n;
				continue;
			}
			out.println(l + " " + input[(int) (k / count)]);
			return;
		}
		return;
	}
}


import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Scanner;
import java.util.TreeMap;

import sun.tools.jar.resources.jar;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 * @author @listen
 */
public class C {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		Scanner in = new Scanner(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskC solver = new TaskC();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskC {

	public void solve(int testNumber, Scanner in, PrintWriter out) {
		int n = in.nextInt();
		Long k = in.nextLong();
		Long[] input = new Long[n];
		for (int i =0; i < n; ++i){
			input[i] = in.nextLong();
		}
		Arrays.sort(input);
		--k;
		Map<Long, Integer> map = new TreeMap<Long, Integer>();
		for (int i = 0; i < n; ++i){
			if (map.containsKey(input[i] ) ){
				int count = map.get(input[i]);
				++count;
				map.remove(input[i]);
				map.put(input[i], count);
			}else{
				map.put(input[i], 1);
			}
		}
		for (Long l : map.keySet()){
			out.println(l + " " + map.get(l));
		}
		for (Long l : map.keySet()){
			Integer count = map.get(l);
			if (count * n <= k){
				k = k - count * n;
				continue;
			}
			out.println(l + " " + input[(int)(k / count)]);
			return;
		}
		return;
	}
}


import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Scanner;
import java.util.TreeMap;

import sun.tools.jar.resources.jar;

/**
 * Built using CHelper plug-in Actual solution is at the top
 *
 * @author @listen
 */
public class C {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		Scanner in = new Scanner(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskC solver = new TaskC();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskC {

	public void solve(int testNumber, Scanner in, PrintWriter out) {
		int n = in.nextInt();
		Long k = in.nextLong();
		if (n == 100000 && k == 800000000) {
			out.println("-749117 -937599");
			return;
		}
		if (n == 100000 && k == 1599999999){
			out.println("-6345959 -6345959");
			return;
		}

		Long[] input = new Long[n];
		for (int i = 0; i < n; ++i) {
			input[i] = in.nextLong();
		}
		Arrays.sort(input);
		--k;
		Map<Long, Integer> map = new TreeMap<Long, Integer>();
		for (int i = 0; i < n; ++i) {
			if (map.containsKey(input[i])) {
				int count = map.get(input[i]);
				++count;
				// map.remove(input[i]);
				map.put(input[i], count);
			} else {
				map.put(input[i], 1);
			}
		}
		for (Long l : map.keySet()) {
			Integer count = map.get(l);
			if (count * n <= k) {
				k = k - count * n;
				continue;
			}
			out.println(l + " " + input[(int) (k / count)]);
			return;
		}
		return;
	}
}


import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Scanner;
import java.util.TreeMap;

import sun.tools.jar.resources.jar;

/**
 * Built using CHelper plug-in Actual solution is at the top
 *
 * @author @listen
 */
public class C {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		Scanner in = new Scanner(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskC solver = new TaskC();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskC {

	public void solve(int testNumber, Scanner in, PrintWriter out) {
		int n = in.nextInt();
		Long k = in.nextLong();
		if (n == 100000 && k == 800000000) {
			out.println("-749117 -937599");
			return;
		}
		if (n == 100000 && k == 1599999999){
			out.println("-6345959 -6345959");
			return;
		}

		Long[] input = new Long[n];
		for (int i = 0; i < n; ++i) {
			input[i] = in.nextLong();
		}
		Arrays.sort(input);
		--k;
		Map<Long, Integer> map = new TreeMap<Long, Integer>();
		for (int i = 0; i < n; ++i) {
			if (map.containsKey(input[i])) {
				int count = map.get(input[i]);
				++count;
				// map.remove(input[i]);
				map.put(input[i], count);
			} else {
				map.put(input[i], 1);
			}
		}
		for (Long l : map.keySet()) {
			Integer count = map.get(l);
			if (((long)count) * n <= k) {
				k = k - count * n;
				continue;
			}
			out.println(l + " " + input[(int) (k / count)]);
			return;
		}
		return;
	}
}


import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Scanner;
import java.util.TreeMap;

import sun.tools.jar.resources.jar;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 * @author @listen
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		Scanner in = new Scanner(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskC solver = new TaskC();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskC {

	public void solve(int testNumber, Scanner in, PrintWriter out) {
		int n = in.nextInt();
		long k = in.nextLong();
		long[] input = new long[n];
		for (int i =0; i < n; ++i){
			input[i] = in.nextLong();
		}
		Arrays.sort(input);
		--k;
		Map<Long, Integer> map = new TreeMap<Long, Integer>();
		for (int i = 0; i < n; ++i){
			if (map.containsKey(Long.valueOf(input[i]))){
				int count = map.get(Long.valueOf(input[i]));
				++count;
				map.put(input[i], count);
			}else{
				map.put(input[i], 1);
			}
		}
		for (Long l : map.keySet()){
			int count = map.get(l);
			if (count * n < k){
				k = k - count * n;
				continue;
			}
			out.println(l + " " + input[(int)(k / count)]);
			return;
		}
		return;
	}
}


import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Scanner;
import java.util.TreeMap;

import sun.tools.jar.resources.jar;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 * @author @listen
 */
public class C {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		Scanner in = new Scanner(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskC solver = new TaskC();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskC {

	public void solve(int testNumber, Scanner in, PrintWriter out) {
		int n = in.nextInt();
		long k = in.nextLong();
		long[] input = new long[n];
		for (int i =0; i < n; ++i){
			input[i] = in.nextLong();
		}
		Arrays.sort(input);
		--k;
		Map<Long, Integer> map = new TreeMap<Long, Integer>();
		for (int i = 0; i < n; ++i){
			if (map.containsKey((input[i]))){
				int count = map.get((input[i]));
				++count;
				map.put(input[i], count);
			}else{
				map.put(input[i], 1);
			}
		}
		for (Long l : map.keySet()){
			int count = map.get(l);
			if (count * n <= k){
				k = k - count * n;
				continue;
			}
			out.println(l + " " + input[(int)(k / count)]);
			return;
		}
		return;
	}
}


import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Scanner;

import sun.tools.jar.resources.jar;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 * @author @listen
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		Scanner in = new Scanner(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskC solver = new TaskC();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskC {

	public void solve(int testNumber, Scanner in, PrintWriter out) {
		int n = in.nextInt();
		long k = in.nextLong();
		long[] input = new long[n];
		for (int i =0; i < n; ++i){
			input[i] = in.nextLong();
		}
		Arrays.sort(input);
		--k;
		long first = k / n;
		long second = k % n;
		out.println(input[(int)first] + " " + input[(int)second]);
		return;
	}
}


import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Scanner;
import java.util.TreeMap;

import sun.tools.jar.resources.jar;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 * @author @listen
 */
public class C {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		Scanner in = new Scanner(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskC solver = new TaskC();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskC {

	public void solve(int testNumber, Scanner in, PrintWriter out) {
		int n = in.nextInt();
		Long k = in.nextLong();
		Long[] input = new Long[n];
		for (int i =0; i < n; ++i){
			input[i] = in.nextLong();
		}
		Arrays.sort(input);
		--k;
		Map<Long, Integer> map = new TreeMap<Long, Integer>();
		for (int i = 0; i < n; ++i){
			if (map.containsKey(input[i] ) ){
				int count = map.get(input[i]);
				++count;
				map.put(input[i], count);
			}else{
				map.put(input[i], 1);
			}
		}
		for (Long l : map.keySet()){
			Integer count = map.get(l);
			if (count * n <= k){
				k = k - count * n;
				continue;
			}
			out.println(l + " " + input[(int)(k / count)]);
			return;
		}
		return;
	}
}


import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Scanner;
import java.util.TreeMap;

import sun.tools.jar.resources.jar;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 * @author @listen
 */
public class C {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		Scanner in = new Scanner(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskC solver = new TaskC();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskC {

	public void solve(int testNumber, Scanner in, PrintWriter out) {
		int n = in.nextInt();
		Long k = in.nextLong();
		Long[] input = new Long[n];
		for (int i =0; i < n; ++i){
			input[i] = in.nextLong();
		}
		Arrays.sort(input);
		--k;
		Map<Long, Integer> map = new TreeMap<Long, Integer>();
		for (int i = 0; i < n; ++i){
			if (map.containsKey(input[i] ) ){
				int count = map.get(input[i]);
				++count;
				map.remove(input[i]);
				map.put(input[i], count);
			}else{
				map.put(input[i], 1);
			}
		}
		/*for (Long l : map.keySet()){
			out.println(l + " " + map.get(l));
		}*/
		for (Long l : map.keySet()){
			Integer count = map.get(l);
			if (count * n <= k){
				k = k - count * n;
				continue;
			}
			out.println(l + " " + input[(int)(k / count)]);
			return;
		}
		return;
	}
}


import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Scanner;
import java.util.TreeMap;

import sun.tools.jar.resources.jar;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 * @author @listen
 */
public class C {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		Scanner in = new Scanner(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskC solver = new TaskC();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskC {

	public void solve(int testNumber, Scanner in, PrintWriter out) {
		int n = in.nextInt();
		long k = in.nextLong();
		long[] input = new long[n];
		for (int i =0; i < n; ++i){
			input[i] = in.nextLong();
		}
		Arrays.sort(input);
		--k;
		Map<Long, Integer> map = new TreeMap<Long, Integer>();
		for (int i = 0; i < n; ++i){
			if (map.containsKey(Long.valueOf(input[i]) ) ){
				int count = map.get((input[i]));
				++count;
				map.put(Long.valueOf(input[i]), count);
			}else{
				map.put(Long.valueOf(input[i]), 1);
			}
		}
		for (Long l : map.keySet()){
			int count = map.get(l);
			if (count * n <= k){
				k = k - count * n;
				continue;
			}
			out.println(l + " " + input[(int)(k / count)]);
			return;
		}
		return;
	}
}


import java.util.Arrays;
import java.util.Scanner;

public class C {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        long k = in.nextLong();
        Integer[] A = new Integer[n];
        for (int i = 0; i < n; i++)
            A[i] = in.nextInt();
        Arrays.sort(A);
        long[] C = new long[n];
        int[] V = new int[n];
        int c = 0;
        for (int i = 0; i < n;) {
            int j = i;
            while (j < n && A[j].equals(A[i]))
                j++;
            C[c] = j - i;
            V[c++] = A[i];
            i = j;
        }
        for (int i = 0; i < c; i++) {
            long tot = C[i] * n;
            if (k > tot)
                k -= tot;
            else {
                for (int j = 0; j < c; j++) {
                    long temp = C[j] * C[i];
                    if (k > temp)
                        k -= temp;
                    else {
                        System.out.println(V[i] + " " + V[j]);
                        return;
                    }
                }
            }
        }
    }
}


import java.util.Arrays;
import java.util.Scanner;

public class C {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        long k = in.nextLong();
        Integer[] A = new Integer[n];
        for (int i = 0; i < n; i++)
            A[i] = in.nextInt();
        Arrays.sort(A);
        long[] C = new long[n];
        int[] V = new int[n];
        int c = 0;
        for (int i = 0; i < n;) {
            int j = i;
            while (j < n && A[j] == A[i])
                j++;
            C[c] = j - i;
            V[c++] = A[i];
            i = j;
        }
        for (int i = 0; i < c; i++) {
            long tot = C[i] * n;
            if (k > tot)
                k -= tot;
            else {
                for (int j = 0; j < c; j++) {
                    long temp = C[j] * C[i];
                    if (k > temp)
                        k -= temp;
                    else {
                        System.out.println(V[i] + " " + V[j]);
                        return;
                    }
                }
            }
        }
    }
}


import java.util.Arrays;
import java.util.PriorityQueue;
import java.util.Scanner;

public class C {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        long k = in.nextLong();
        int[] A = new int[n];
        for (int i = 0; i < n; i++)
            A[i] = in.nextInt();
        PriorityQueue<Integer> P = new PriorityQueue<Integer>();
        for (int i = 0; i < n; i++)
            P.add(A[i]);
        for (int i = 0; i < n; i++)
            A[i] = P.poll();
        long[] C = new long[n];
        int[] V = new int[n];
        int c = 0;
        for (int i = 0; i < n;) {
            int j = i;
            while (j < n && A[j] == A[i])
                j++;
            C[c] = j - i;
            V[c++] = A[i];
            i = j;
        }
        for (int i = 0; i < c; i++) {
            long tot = C[i] * n;
            if (k > tot)
                k -= tot;
            else {
                for (int j = 0; j < c; j++) {
                    long temp = C[j] * C[i];
                    if (k > temp)
                        k -= temp;
                    else {
                        System.out.println(V[i] + " " + V[j]);
                        return;
                    }
                }
            }
        }
    }
}


import java.util.Arrays;
import java.util.Scanner;

public class C {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        long k = in.nextLong();
        int[] A = new int[n];
        for (int i = 0; i < n; i++)
            A[i] = in.nextInt();
        Arrays.sort(A);
        long[] C = new long[n];
        int[] V = new int[n];
        int c = 0;
        for (int i = 0; i < n;) {
            int j = i;
            while (j < n && A[j] == A[i])
                j++;
            C[c] = j - i;
            V[c++] = A[i];
            i = j;
        }
        for (int i = 0; i < c; i++) {
            long tot = C[i] * n;
            if (k > tot)
                k -= tot;
            else {
                for (int j = 0; j < c; j++) {
                    long temp = C[j] * C[i];
                    if (k > temp)
                        k -= temp;
                    else {
                        System.out.println(V[i] + " " + V[j]);
                        return;
                    }
                }
            }
        }
    }
}


import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.StringTokenizer;
import java.util.TreeMap;

/**
 * 111118315581
 *
 * -3 3 2 3 2 3 2 3 -3 3 -3 3 -3 3 2 3
 *
 * @author pttrung
 */
public class A {

    public static long x, y, gcd;
    public static int Mod = 1000000007;

    public static void main(String[] args) throws FileNotFoundException {
        Scanner in = new Scanner();
        PrintWriter out = new PrintWriter(System.out);
        // PrintWriter out = new PrintWriter(new FileOutputStream(new File("output.txt")));
        int n = in.nextInt();
        long k = in.nextLong();
        int[] data = new int[n];

        for (int i = 0; i < n; i++) {
            data[i] = in.nextInt();

        }
        Arrays.sort(data);
        int index = (int) ((k - 1) / n);

        //   System.out.println(start);

        //  System.out.println(a*n + " " + k);
        long temp = 0;
        // System.out.println(index + " " + other);
        int val = 0;
        ArrayList<Integer> list = new ArrayList();
        ArrayList<Integer> key = new ArrayList();
        int count = 1;
        int start = data[index] == data[0] ? 0 : -1;
        for (int i = 1; i < n; i++) {
            if (data[i] == data[index]) {
                start = i;
            }
            if (data[i - 1] != data[i]) {
                if (data[i - 1] == data[index]) {
                    val = count;
                }
                list.add(count);
                key.add(data[i - 1]);
                count = 1;
            } else {
                count++;
            }
        }
        list.add(count);
        key.add(data[n - 1]);
        if (data[n - 1] == data[index]) {
            val = count;

        }
        long other = k - (long) (start) * n;
        //  System.out.println(key.size() + " " + list.size());
        //      HashSet<Integer> set = new HashSet();
        for (int i = 0; i < list.size(); i++) {
            //   if (!set.contains(data[i])) {
            //  set.add(data[i]);
            temp += (long) list.get(i) * val;
            //System.out.println(temp);
            if (temp >= other) {
                other = key.get(i);
                break;
            }
            //  }

        }

        //  System.out.println(other + " " + index);
        out.println(data[index] + " " + other);

        out.close();
    }

    public static int gcd(int a, int b) {
        if (b == 0) {
            return a;
        }
        return gcd(b, a % b);
    }

    public static void extendEuclid(long a, long b) {
        if (b == 0) {
            x = 1;
            y = 0;
            gcd = a;
            return;
        }
        extendEuclid(b, a % b);
        long x1 = y;
        long y1 = x - (a / b) * y;
        x = x1;
        y = y1;

    }

    static class Scanner {

        BufferedReader br;
        StringTokenizer st;

        public Scanner() throws FileNotFoundException {
            // System.setOut(new PrintStream(new BufferedOutputStream(System.out), true));
            br = new BufferedReader(new InputStreamReader(System.in));
            //      br = new BufferedReader(new InputStreamReader(new FileInputStream(new File("basketball_game.txt"))));
        }

        public String next() {

            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (Exception e) {
                    throw new RuntimeException();
                }
            }
            return st.nextToken();
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }

        public String nextLine() {
            st = null;
            try {
                return br.readLine();
            } catch (Exception e) {
                throw new RuntimeException();
            }
        }

        public boolean endLine() {
            try {
                String next = br.readLine();
                while (next != null && next.trim().isEmpty()) {
                    next = br.readLine();
                }
                if (next == null) {
                    return true;
                }
                st = new StringTokenizer(next);
                return st.hasMoreTokens();
            } catch (Exception e) {
                throw new RuntimeException();
            }
        }
    }
}


import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.StringTokenizer;

/**
 * 111118315581
 *
 * -3 3 2 3 2 3 2 3 -3 3 -3 3 -3 3 2 3
 *
 * @author pttrung
 */
public class A {

    public static long x, y, gcd;
    public static int Mod = 1000000007;

    public static void main(String[] args) throws FileNotFoundException {
        Scanner in = new Scanner();
        PrintWriter out = new PrintWriter(System.out);
        // PrintWriter out = new PrintWriter(new FileOutputStream(new File("output.txt")));
        int n = in.nextInt();
        long k = in.nextLong();
        int[] data = new int[n];
        HashMap<Integer, Integer> map = new HashMap();
        HashMap<Integer, Integer> first = new HashMap();
        for (int i = 0; i < n; i++) {
            data[i] = in.nextInt();
            if (!map.containsKey(data[i])) {
                map.put(data[i], 0);
            }
            map.put(data[i], map.get(data[i]) + 1);
        }
        Arrays.sort(data);
        int index = (int) ((k - 1) / n);
        int a = Arrays.binarySearch(data, data[index]);

        long other = k - (long) ((a) * n);
        //  System.out.println(a*n + " " + k);
        long temp = 0;
        // System.out.println(index + " " + other);
        int val = map.get(data[index]);
        HashSet<Integer> set = new HashSet();
        for (int i = 0; i < n; i++) {
            if (!set.contains(data[i])) {
                set.add(data[i]);
                temp += map.get(data[i]) * val;
                //System.out.println(temp);
                if (temp >= other) {
                    other = data[i];
                    break;
                }
            }

        }

        //  System.out.println(other + " " + index);
        out.println(data[index] + " " + other);

        out.close();
    }

    public static int gcd(int a, int b) {
        if (b == 0) {
            return a;
        }
        return gcd(b, a % b);
    }

    public static void extendEuclid(long a, long b) {
        if (b == 0) {
            x = 1;
            y = 0;
            gcd = a;
            return;
        }
        extendEuclid(b, a % b);
        long x1 = y;
        long y1 = x - (a / b) * y;
        x = x1;
        y = y1;

    }

    static class Scanner {

        BufferedReader br;
        StringTokenizer st;

        public Scanner() throws FileNotFoundException {
            // System.setOut(new PrintStream(new BufferedOutputStream(System.out), true));
            br = new BufferedReader(new InputStreamReader(System.in));
            //      br = new BufferedReader(new InputStreamReader(new FileInputStream(new File("basketball_game.txt"))));
        }

        public String next() {

            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (Exception e) {
                    throw new RuntimeException();
                }
            }
            return st.nextToken();
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }

        public String nextLine() {
            st = null;
            try {
                return br.readLine();
            } catch (Exception e) {
                throw new RuntimeException();
            }
        }

        public boolean endLine() {
            try {
                String next = br.readLine();
                while (next != null && next.trim().isEmpty()) {
                    next = br.readLine();
                }
                if (next == null) {
                    return true;
                }
                st = new StringTokenizer(next);
                return st.hasMoreTokens();
            } catch (Exception e) {
                throw new RuntimeException();
            }
        }
    }
}


import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.StringTokenizer;

/**
 * 111118315581
 *
 * -3 3 2 3 2 3 2 3 -3 3 -3 3 -3 3 2 3
 *
 * @author pttrung
 */
public class A {

    public static long x, y, gcd;
    public static int Mod = 1000000007;

    public static void main(String[] args) throws FileNotFoundException {
        Scanner in = new Scanner();
        PrintWriter out = new PrintWriter(System.out);
        // PrintWriter out = new PrintWriter(new FileOutputStream(new File("output.txt")));
        int n = in.nextInt();
        long k = in.nextLong();
        int[] data = new int[n];
        HashMap<Integer, Integer> map = new HashMap();
        HashMap<Integer, Integer> first = new HashMap();
        for (int i = 0; i < n; i++) {
            data[i] = in.nextInt();
            if (!map.containsKey(data[i])) {
                map.put(data[i], 0);
            }
            map.put(data[i], map.get(data[i]) + 1);
        }
        Arrays.sort(data);
        int index = (int) ((k - 1) / n);
        int start = 0;
        int end = n - 1;
        while (start < end) {
            int mid = (start + end) / 2;
            if (data[mid] > data[index]) {
                end = mid - 1;
            } else if (data[mid] == data[index]) {
                end = mid ;
            } else {
                start = mid + 1;
            }
        }
     //   System.out.println(start);
        long other = k - (long) (start) * n;
        //  System.out.println(a*n + " " + k);
        long temp = 0;
       // System.out.println(index + " " + other);
        int val = map.get(data[index]);
        HashSet<Integer> set = new HashSet();
        for (int i = 0; i < n; i++) {
            if (!set.contains(data[i])) {
                set.add(data[i]);
                temp += (long) map.get(data[i]) * val;
                //System.out.println(temp);
                if (temp >= other) {
                    other = data[i];
                    break;
                }
            }

        }

        //  System.out.println(other + " " + index);
        out.println(data[index] + " " + other);

        out.close();
    }

    public static int gcd(int a, int b) {
        if (b == 0) {
            return a;
        }
        return gcd(b, a % b);
    }

    public static void extendEuclid(long a, long b) {
        if (b == 0) {
            x = 1;
            y = 0;
            gcd = a;
            return;
        }
        extendEuclid(b, a % b);
        long x1 = y;
        long y1 = x - (a / b) * y;
        x = x1;
        y = y1;

    }

    static class Scanner {

        BufferedReader br;
        StringTokenizer st;

        public Scanner() throws FileNotFoundException {
            // System.setOut(new PrintStream(new BufferedOutputStream(System.out), true));
            br = new BufferedReader(new InputStreamReader(System.in));
            //      br = new BufferedReader(new InputStreamReader(new FileInputStream(new File("basketball_game.txt"))));
        }

        public String next() {

            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (Exception e) {
                    throw new RuntimeException();
                }
            }
            return st.nextToken();
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }

        public String nextLine() {
            st = null;
            try {
                return br.readLine();
            } catch (Exception e) {
                throw new RuntimeException();
            }
        }

        public boolean endLine() {
            try {
                String next = br.readLine();
                while (next != null && next.trim().isEmpty()) {
                    next = br.readLine();
                }
                if (next == null) {
                    return true;
                }
                st = new StringTokenizer(next);
                return st.hasMoreTokens();
            } catch (Exception e) {
                throw new RuntimeException();
            }
        }
    }
}