#include
#include
using namespace std ;
int main()
{
int n ;
int a[n] ;
cin >> n ;
for(int i=0;i<n;i++)
{
cin >>a[i] ;
}
sort(a,a+n);
int target ;
cin >> target ;
int j=n-1 ;
int i=0 ;
while(i<=j)
{
int s =a[i]+a[j];
if(s==target)
{
cout <<a[i]<<" and "<<a[j]<<endl;
i++ ;
j-- ;
}
else{ if(s>target)
j-- ;
else
i++ ;
}
}
} //// 4th testcase is not running when submitting the code …