import java.util.Scanner;
public class Main{
public static void dfs(int[] arr,int k){
int n = arr.length;
int l = 0,r = n - 1;
while(l < r){
if(l > 0 && arr[l] == arr[l - 1]){
l++;
continue;
}
if(arr[l] + arr[r] == k){
System.out.println(arr[l] + " " + arr[r]);
l++;
r--;
}else if(arr[l] + arr[r] > k){
r--;
}else{
l++;
}
}
}
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int num = sc.nextInt();
int k = sc.nextInt();
int[] arr = new int[num];
int index = 0;
while(sc.hasNext()){
arr[index++] = sc.nextInt();
}
dfs(arr,k);
}
}
public class Main{
public static void dfs(int[] arr,int k){
int n = arr.length;
int l = 0,r = n - 1;
while(l < r){
if(l > 0 && arr[l] == arr[l - 1]){
l++;
continue;
}
if(arr[l] + arr[r] == k){
System.out.println(arr[l] + " " + arr[r]);
l++;
r--;
}else if(arr[l] + arr[r] > k){
r--;
}else{
l++;
}
}
}
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int num = sc.nextInt();
int k = sc.nextInt();
int[] arr = new int[num];
int index = 0;
while(sc.hasNext()){
arr[index++] = sc.nextInt();
}
dfs(arr,k);
}
}