#include <bits/stdc++.h>
using namespace std;
const int N = 1e6,INF = 0x3f3f3f3f;
int a[N];
int n,x;
void fun(int n)
{
int left = 0, right = n-1;
while(left < right)
{
int ans=a[left] + a[right];
if(ans == x)
{
cout<<a[left]<<' '<<a[right]<<endl;
left++, right--;
}
else if(ans < x)
{
left++;
}
else if(ans > x)
{
right--;
}
}
}
int main()
{
cin>>n>>x;
for(int i=0;i<n;i++) {
cin>>a[i];
}
fun(n);
}
/*
9 16
1 2 3 5 6 7 11 13 15
*/