#include <bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin>>t;
while(tβ)
{
int n;
cin>>n;
int a[n];
for(int i=0;i<n;i++)
{
cin>>a[i];
}
int m;
cin>>m;
int cn=0;
int mini=INT_MAX;
int f=0,s=0;
for(int i=0;i<n-1;i++)
{
for(int j=i+1;j<n;j++)
{
if(a[i]+a[j]==m)
{
if(mini>abs(a[j]-a[i]))
{
mini=abs(a[j]-a[i]);
f=i;
s=j;
}
}
}
}
cout<<"Deepak should buy roses whose prices are β<<a[s]<<β and "<<a[f]<<endl;
}
}