#include <bits/stdc++.h>

#define ll long long
#define inf 9e18

using namespace std;

int main()
{
    ll t;
    cin >> t;
    while(t--)
    {
        ll arr[4], i;
        for(i = 0; i < 4; i++)
        {
            cin >> arr[i];
        }
        ll x = arr[1], y = arr[2], z = arr[3];
        if(x + y > z && y + z && x && z + x > y)
        {
            cout << x << " " << y << " " << z << endl;
        }
        else
        {
            x++;
            for(i = 0; i < z; i++)
            {
                if(x + y > z && y + z && x && z + x > y)
                {
                    cout << x << " " << y << " " << z << endl;
                    break;
                }
                else
                {
                    x++;
                }

            }
        }

    }
}


#include<bits/stdc++.h>
using namespace std;
int main(){
   int t;
   cin>>t;
   while(t--){
       int a,b,c,d;
       cin>>a>>b>>c>>d;
       int x=a;
       int y=b;
       int z=c;
       while(x<b && y<c && z<d){
           if(x<b){
               x++;
           }
            if(y<c){
               y++;
           }
            if(z<d){
               z++;
           }
           if(x+y>z && y-x<z){
               break;
           }
           }
           cout<<x<<" "<<y<<" "<<z<<endl;
       }

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main(){
   int t;
   cin>>t;
   while(t--){
       int a,b,c,d;
       cin>>a>>b>>c>>d;
       cout<<b<<" "<<c<<" "<<d<<endl;
   }

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main(){
    int t;
    cin>>t;
    while(t--){
    int a,b,c,d;
    cin>>a>>b>>c>>d;
    cout<<b<<" "<<c<<" "<<c<<endl;
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main(){
    int t;
    cin>>t;
    while(t--){
    int a,b,c,d;
    cin>>a>>b>>c>>d;
    cout<<a<<" "<<b<<" "<<b<<endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main(){
   int t;
   cin>>t;
   while(t--){
     long long  int a,b,c,d;
       cin>>a>>b>>c>>d;
     long long int x=b;
      long long int y=c;
      long long int z=d;
       while(x>a){

           if(x+y>z && y-x<z){
               break;
           }
           if(x>a){
               x--;
           }

            if(y>b){
               y--;
           }

            if(z>d){
               z--;
           }

           }
           cout<<x<<" "<<y<<" "<<z<<endl;
       }

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main(){
    int t;
    cin>>t;
    while(t--){
    int a,b,c,d;
    cin>>a>>b>>c>>d;
    cout<<a<<" "<<b<<" "<<b<<endl;
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main(){
   int t;
   cin>>t;
   while(t--){
       int a,b,c,d;
       cin>>a>>b>>c>>d;
       int x=a;
       int y=b;
       int z=c;
       while(1000000000){
           if(x<b){
               x++;
           }
            if(y<c){
               y++;
           }
            if(z<d){
               z++;
           }
           if(x+y>z && y-x<z){
               break;
           }
           }
           cout<<x<<" "<<y<<" "<<z<<endl;
       }

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main(){
    int t;
    cin>>t;
    while(t--){
    int a,b,c,d;
    cin>>a>>b>>c>>d;
    cout<<b<<" "<<b<<" "<<d<<endl;
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main(){
    int t
    cin>>t;
    while(t--){
    int a,b,c,d;
    cin>>a>>b>>c>>d;
    cout<<a<<" "<<b<<" "<<b<<endl;
    return 0;
}


#include <iostream>

using namespace std;

int main()
{
    int n,a,b,c,d,x=0,y=0,z=0;
    cin>>n;
    while(n--){
    cin>>a>>b>>c>>d;
    if(a-b>c-b)
    {
        x=b;
    }
    else
        x=a;
    if(b-c>c-d)
        y=c;
    else
        y=b;
    z=d;
    while(1){
    if(x+y>z && y+z>x && z+x>y)
    {
    cout<<x<<" "<<y<<" "<<z<<" "<<endl;
    break;
    }
    if(x<b)
        x++;
    if(y<c)
        y++;
    if(z<d)
        z++;
    }
    }
    return 0;
}


#include <iostream>

using namespace std;

int main()
{
    int n,a,b,c,d,x,y,z;
    cin>>n;
    while(n--)
    {
        cin>>a>>b>>c>>d;
        for(int i=a;i<d;i++)
        {
            if(a<i<b)
                x=i;
            else if(b<i<c)
                y=i;
            else if(c<i<d)
                z=i;
            else if(x+y>z && y+z>x && z+x>y){
                cout<<x<<" "<<y<<" "<<z<<endl;
                break;
            }
        }
    }

    return 0;
}


#include <iostream>

using namespace std;

int main()
{
    int n,a,b,c,d,x=0,y=0,z=0;
    cin>>n;
    while(n--){
    cin>>a>>b>>c>>d;
    cout<<b<<" "<<c<<" "<<c<<endl;
    }
    return 0;
}


#include <iostream>

using namespace std;

int main()
{
    int n,a,b,c,d,x=0,y=0,z=0;
    cin>>n;
    while(n--){
    cin>>a>>b>>c>>d;
    cout<<a<<" "<<b<<" "<<b<<endl;
    return 0;
}


#include <iostream>

using namespace std;

int main()
{
    int n,a,b,c,d,x=0,y=0,z=0;
    cin>>n;
    while(n--){
    cin>>a>>b>>c>>d;
    cout<<a<<" "<<b<<" "<<b<<endl;
    }
    return 0;
}


#include <iostream>

using namespace std;

int main()
{
    int n,a,b,c,d,x=0,y=0,z=0;
    cin>>n;
    while(n--){
    cin>>a>>b>>c>>d;
    if(a+b>c && b+c>a && a+c>b)
        cout<<a<<" "<<b<<" "<<c<<endl;
    else if(b+c>d && c+d>b && b+d>c)
        cout<<b<<" "<<c<<" "<<d<<" "<<endl;
    }
    return 0;
}


using namespace std;

int main()
{
    int n,a,b,c,d,x=0,y=0,z=0;
    cin>>n;
    while(n--){
    cin>>a>>b>>c>>d;
    cout<<a<<" "<<b<<" "<<b<<endl;
    }
    return 0;
}


#include <iostream>

using namespace std;

int main()
{
    int n,a,b,c,d,x=0,y=0,z=0;
    cin>>n;
    while(n--){
    cin>>a>>b>>c>>d;
    cout<<b<<" "<<b<<" "<<c<<endl;
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define Omar45 ios_base::sync_with_stdio(false); cin.tie(NULL);
#define ll long long
#define pb push_back
#define F first
#define S second
#define endl '\n'
const ll mod = 1e9 + 7;
const ll maxN = 1e5 + 5;
const ll INF = 1e18;

int main() {
	Omar45
    int t; cin >> t;
    while (t--){
        ll a, b, c, d;
        cin >> a >> b >> c >> d;
        if (b+c>d && c+d>b && b+d>c)
            cout << b << " " << c << " " << d << endl;
        else if (b+c>a && c+a>b && b+a>c)
            cout << b << " " << c << " " << a << endl;
        else cout << (a+b)/2 << " " << (b+c)/2 << " " << (c+d)/2 << endl;
    }
}


#include <bits/stdc++.h>
using namespace std;

#define Omar45 ios_base::sync_with_stdio(false); cin.tie(NULL);
#define ll long long
#define pb push_back
#define F first
#define S second
#define endl '\n'
const ll mod = 1e9 + 7;
const ll maxN = 1e5 + 5;
const ll INF = 1e18;

int main() {
	Omar45
    int t; cin >> t;
    while (t--){
        ll a, b, c, d;
        cin >> a >> b >> c >> d;
        cout << (a+b)/2 <<" "<< (b+c)/2 <<" "<< (c+d)/2 << endl;
    }
}


#include <bits/stdc++.h>
using namespace std;

#define Omar45 ios_base::sync_with_stdio(false); cin.tie(NULL);
#define ll long long
#define pb push_back
#define F first
#define S second
#define endl '\n'
const ll mod = 1e9 + 7;
const ll maxN = 1e5 + 5;
const ll INF = 1e18;

void solve(){
    ll a, b, c, d;
    bool flag = 0;
    cin >> a >> b >> c >> d;
    //if (flag == 0) {
        for (ll i=b; i>=a; i--){
            for (ll j=c; j>=b; j--){
                //for (ll k=d; k>=c && flag==0; k--){
                    if (i+j>d && i+d>j && d+j>i) {
                        cout << i << " " << j << " " << d << endl;
                        return;
                    }
                //}
            }
        }
    //}
}

int main() {
	Omar45
    int t; cin >> t;
    while (t--){
        solve();
    }
}


#include <bits/stdc++.h>
using namespace std;

#define Omar45 ios_base::sync_with_stdio(false); cin.tie(NULL);
#define ll long long
#define pb push_back
#define F first
#define S second
#define endl '\n'
const ll mod = 1e9 + 7;
const ll maxN = 1e5 + 5;
const ll INF = 1e18;

int main() {
	Omar45
    int t; cin >> t;
    while (t--){
        ll a, b, c, d;
        cin >> a >> b >> c >> d;
        cout << a <<" "<< c <<" "<< c << endl;
    }
}


#include <bits/stdc++.h>
using namespace std;

#define Omar45 ios_base::sync_with_stdio(false); cin.tie(NULL);
#define ll long long
#define pb push_back
#define F first
#define S second
#define endl '\n'
const ll mod = 1e9 + 7;
const ll maxN = 1e5 + 5;
const ll INF = 1e18;

void solve(){
    ll a, b, c, d;
    bool flag = 0;
    cin >> a >> b >> c >> d;
    //if (flag == 0) {
        for (ll i=b; i>=a; i--){
            for (ll j=c; j>=b; j--){
                for (ll k=d; k>=c && flag==0; k--){
                    if (i+j>k && i+k>j && k+j>i) {
                        cout << i << " " << j << " " << k << endl;
                        return;
                    }
                }
            }
        }
    //}
}

int main() {
	Omar45
    int t; cin >> t;
    while (t--){
        solve();
    }
}


#include <bits/stdc++.h>
using namespace std;

#define Omar45 ios_base::sync_with_stdio(false); cin.tie(NULL);
#define ll long long
#define pb push_back
#define F first
#define S second
#define endl '\n'
const ll mod = 1e9 + 7;
const ll maxN = 1e5 + 5;
const ll INF = 1e18;

int main() {
	Omar45
    int t; cin >> t;
    while (t--){
        ll a, b, c, d;
        cin >> a >> b >> c >> d;
        cout << b <<" "<< c <<" "<< d << endl;
    }
}


#include <bits/stdc++.h>
using namespace std;

#define Omar45 ios_base::sync_with_stdio(false); cin.tie(NULL);
#define ll long long
#define pb push_back
#define F first
#define S second
#define endl '\n'
const ll mod = 1e9 + 7;
const ll maxN = 1e5 + 5;
const ll INF = 1e18;

void solve(){
    ll a, b, c, d;
    bool flag = 0;
    cin >> a >> b >> c >> d;
    //if (flag == 0) {
        for (ll i=b; i>=a; i--){
            //for (ll j=c; j>=b; j--){
                //for (ll k=d; k>=c && flag==0; k--){
                    if (i+c>d && i+d>c && d+c>i) {
                        cout << i << " " << c << " " << d << endl;
                        return;
                    }
                //}
            //}
        }
    //}
}

int main() {
	Omar45
    int t; cin >> t;
    while (t--){
        solve();
    }
}


#include <bits/stdc++.h>
using namespace std;

#define Omar45 ios_base::sync_with_stdio(false); cin.tie(NULL);
#define ll long long
#define pb push_back
#define F first
#define S second
#define endl '\n'
const ll mod = 1e9 + 7;
const ll maxN = 1e5 + 5;
const ll INF = 1e18;

void solve(){
    ll a, b, c, d;
    bool flag = 0;
    cin >> a >> b >> c >> d;
    //if (flag == 0) {
        for (ll i=b; i>=a; i--){
            for (ll j=c; j>=b; j--){
                //for (ll k=d; k>=c && flag==0; k--){
                    if (i+c>d && i+d>c && d+c>i) {
                        cout << i << " " << c << " " << d << endl;
                        return;
                    }
                //}
            }
        }
    //}
}

int main() {
	Omar45
    int t; cin >> t;
    while (t--){
        solve();
    }
}


#include <bits/stdc++.h>
#include <stdint.h>
using namespace std;
#define rep(i, a, n) for (int i = a; i < n; i++)
#define per(i, a, n) for (int i = n - 1; i >= a; i--)
#define pb push_back
#define mp make_pair
#define endl "\n"
#define clr(x) memset(x, 0, sizeof(x))
#define all(x) (x).begin(), (x).end()
#define fi first
#define se second
#define sz(x) ((int)(x).size())
#define int long long
typedef vector<int> vi;
typedef pair<int, int> pii;
const double PI = acos(-1.0);
const int mod = 1e9 + 7;
int pows(int a , int b){int res=1;for(int i=0; i<b; ++i){res*=a;}return res;}
const int N = 1e4+5;
bool vis[N] ;
vector<int> v[N];

/* Iterative Function to calculate (x^y)%p in O(log y) */
int power(int x, unsigned int y, int p)
{
    int res = 1;     // Initialize result

    x = x % p; // Update x if it is more than or
                // equal to p

    while (y > 0)
    {
        // If y is odd, multiply x with result
        if (y & 1)
            res = (res*x) % p;

        // y must be even now
        y = y>>1; // y = y/2
        x = (x*x) % p;
    }
    return res;
}

void init() {
  ios_base::sync_with_stdio(false);
  std::cin.tie(NULL);
}
bool prime(int n)
{
    int c = 0;
    for(int i = 2 ; i*i <= n ; i++){
        if(n%i==0)
            c++;
    }
    if(c>0)
        return false;
    else
        return true;
}
void dfs(int s){
    vis[s]=true;
    for(int i = 0 ; i < v[s].size() ; i++){
        if(!vis[v[s][i]])
            dfs(v[s][i]);
    }
}
void solve(){
    //1 5 5 7
    int a , b , c , d ;
    cin >> a >> b >> c >> d ;
    if(a+b > c)
        cout << a << " " << b << " " << c << endl ;
    else if(b+c > d)
        cout << b << " " << c << " " << d << endl ;
}
int32_t main()
{
    init();
    int t=1;
    cin>>t;
    clock_t launch=clock();

    while(t--)
    {
        solve();
    }

    clog<<((long double)(clock()-launch)/CLOCKS_PER_SEC)<<"\n";
}


#include<bits/stdc++.h>
#define ll long long
using namespace std ;

int main(){
    ll t ;
    cin >> t ;
    while(t--){
        ll a , b , c , d ;
        cin >> a >> b >> c >> d ;
        cout << b << " " << c << " " << c << endl ;
    }
}


#include <bits/stdc++.h>
#include <stdint.h>
using namespace std;
#define rep(i, a, n) for (int i = a; i < n; i++)
#define per(i, a, n) for (int i = n - 1; i >= a; i--)
#define pb push_back
#define mp make_pair
#define endl "\n"
#define clr(x) memset(x, 0, sizeof(x))
#define all(x) (x).begin(), (x).end()
#define fi first
#define se second
#define sz(x) ((int)(x).size())
#define int long long
typedef vector<int> vi;
typedef pair<int, int> pii;
const double PI = acos(-1.0);
const int mod = 1e9 + 7;
int pows(int a , int b){int res=1;for(int i=0; i<b; ++i){res*=a;}return res;}
const int N = 1e4+5;
bool vis[N] ;
vector<int> v[N];

/* Iterative Function to calculate (x^y)%p in O(log y) */
int power(int x, unsigned int y, int p)
{
    int res = 1;     // Initialize result

    x = x % p; // Update x if it is more than or
                // equal to p

    while (y > 0)
    {
        // If y is odd, multiply x with result
        if (y & 1)
            res = (res*x) % p;

        // y must be even now
        y = y>>1; // y = y/2
        x = (x*x) % p;
    }
    return res;
}

void init() {
  ios_base::sync_with_stdio(false);
  std::cin.tie(NULL);
}
bool prime(int n)
{
    int c = 0;
    for(int i = 2 ; i*i <= n ; i++){
        if(n%i==0)
            c++;
    }
    if(c>0)
        return false;
    else
        return true;
}
void dfs(int s){
    vis[s]=true;
    for(int i = 0 ; i < v[s].size() ; i++){
        if(!vis[v[s][i]])
            dfs(v[s][i]);
    }
}
void solve(){
    int a , b , c , d ;
    cin >> a >> b >> c >> d ;
    if(b==c && c==d)
        cout << c <<" "<< c <<" " << (c) << endl ;
    else
        cout <<(b==c ? b : (a==b ? b : b-1) )  <<" "<< (c==d ? c : (b==c ? c : c-1) ) <<" " << (c!=d ? (c+1) : c) << endl ;
}
int32_t main()
{
    init();
    int t=1;
    cin>>t;
    clock_t launch=clock();

    while(t--)
    {
        solve();
    }

    clog<<((long double)(clock()-launch)/CLOCKS_PER_SEC)<<"\n";
}


#include <bits/stdc++.h>
#include <stdint.h>
using namespace std;
#define rep(i, a, n) for (int i = a; i < n; i++)
#define per(i, a, n) for (int i = n - 1; i >= a; i--)
#define pb push_back
#define mp make_pair
#define endl "\n"
#define clr(x) memset(x, 0, sizeof(x))
#define all(x) (x).begin(), (x).end()
#define fi first
#define se second
#define sz(x) ((int)(x).size())
#define int long long
typedef vector<int> vi;
typedef pair<int, int> pii;
const double PI = acos(-1.0);
const int mod = 1e9 + 7;
int pows(int a , int b){int res=1;for(int i=0; i<b; ++i){res*=a;}return res;}
const int N = 1e4+5;
bool vis[N] ;
vector<int> v[N];

/* Iterative Function to calculate (x^y)%p in O(log y) */
int power(int x, unsigned int y, int p)
{
    int res = 1;     // Initialize result

    x = x % p; // Update x if it is more than or
                // equal to p

    while (y > 0)
    {
        // If y is odd, multiply x with result
        if (y & 1)
            res = (res*x) % p;

        // y must be even now
        y = y>>1; // y = y/2
        x = (x*x) % p;
    }
    return res;
}

void init() {
  ios_base::sync_with_stdio(false);
  std::cin.tie(NULL);
}
bool prime(int n)
{
    int c = 0;
    for(int i = 2 ; i*i <= n ; i++){
        if(n%i==0)
            c++;
    }
    if(c>0)
        return false;
    else
        return true;
}
void dfs(int s){
    vis[s]=true;
    for(int i = 0 ; i < v[s].size() ; i++){
        if(!vis[v[s][i]])
            dfs(v[s][i]);
    }
}
void solve(){
    //1 5 5 7
    int a , b , c , d ;
    cin >> a >> b >> c >> d ;
    if(a+b > c)
        cout << a << " " << b << " " << c << endl ;
    else if(b+c > d)
        cout << b << " " << c << " " << d << endl ;
    else
        cout << b << " " << (b==c ? c : c-1) << " " << (c==d ? c : d-1) << endl ;
}
int32_t main()
{
    init();
    int t=1;
    cin>>t;
    clock_t launch=clock();

    while(t--)
    {
        solve();
    }

    clog<<((long double)(clock()-launch)/CLOCKS_PER_SEC)<<"\n";
}


#include <bits/stdc++.h>
#include <stdint.h>
using namespace std;
#define rep(i, a, n) for (int i = a; i < n; i++)
#define per(i, a, n) for (int i = n - 1; i >= a; i--)
#define pb push_back
#define mp make_pair
#define endl "\n"
#define clr(x) memset(x, 0, sizeof(x))
#define all(x) (x).begin(), (x).end()
#define fi first
#define se second
#define sz(x) ((int)(x).size())
#define int long long
typedef vector<int> vi;
typedef pair<int, int> pii;
const double PI = acos(-1.0);
const int mod = 1e9 + 7;
int pows(int a , int b){int res=1;for(int i=0; i<b; ++i){res*=a;}return res;}
const int N = 1e4+5;
bool vis[N] ;
vector<int> v[N];

/* Iterative Function to calculate (x^y)%p in O(log y) */
int power(int x, unsigned int y, int p)
{
    int res = 1;     // Initialize result

    x = x % p; // Update x if it is more than or
                // equal to p

    while (y > 0)
    {
        // If y is odd, multiply x with result
        if (y & 1)
            res = (res*x) % p;

        // y must be even now
        y = y>>1; // y = y/2
        x = (x*x) % p;
    }
    return res;
}

void init() {
  ios_base::sync_with_stdio(false);
  std::cin.tie(NULL);
}
bool prime(int n)
{
    int c = 0;
    for(int i = 2 ; i*i <= n ; i++){
        if(n%i==0)
            c++;
    }
    if(c>0)
        return false;
    else
        return true;
}
void dfs(int s){
    vis[s]=true;
    for(int i = 0 ; i < v[s].size() ; i++){
        if(!vis[v[s][i]])
            dfs(v[s][i]);
    }
}
void solve(){
    //1 5 5 7
    int a , b , c , d ;
    cin >> a >> b >> c >> d ;
    if(a+b > c)
        cout << a << " " << b << " " << c << endl ;
    else if(b+c > d)
        cout << b << " " << c << " " << d << endl ;
    else
        cout << b << " " << (b==c ? c : c-1) << " " << (c==d ? c : c+1) << endl ;
}
int32_t main()
{
    init();
    int t=1;
    cin>>t;
    clock_t launch=clock();

    while(t--)
    {
        solve();
    }

    clog<<((long double)(clock()-launch)/CLOCKS_PER_SEC)<<"\n";
}


#include <bits/stdc++.h>
#include <stdint.h>
using namespace std;
#define rep(i, a, n) for (int i = a; i < n; i++)
#define per(i, a, n) for (int i = n - 1; i >= a; i--)
#define pb push_back
#define mp make_pair
#define endl "\n"
#define clr(x) memset(x, 0, sizeof(x))
#define all(x) (x).begin(), (x).end()
#define fi first
#define se second
#define sz(x) ((int)(x).size())
#define int long long
typedef vector<int> vi;
typedef pair<int, int> pii;
const double PI = acos(-1.0);
const int mod = 1e9 + 7;
int pows(int a , int b){int res=1;for(int i=0; i<b; ++i){res*=a;}return res;}
const int N = 1e4+5;
bool vis[N] ;
vector<int> v[N];

/* Iterative Function to calculate (x^y)%p in O(log y) */
int power(int x, unsigned int y, int p)
{
    int res = 1;     // Initialize result

    x = x % p; // Update x if it is more than or
                // equal to p

    while (y > 0)
    {
        // If y is odd, multiply x with result
        if (y & 1)
            res = (res*x) % p;

        // y must be even now
        y = y>>1; // y = y/2
        x = (x*x) % p;
    }
    return res;
}

void init() {
  ios_base::sync_with_stdio(false);
  std::cin.tie(NULL);
}
bool prime(int n)
{
    int c = 0;
    for(int i = 2 ; i*i <= n ; i++){
        if(n%i==0)
            c++;
    }
    if(c>0)
        return false;
    else
        return true;
}
void dfs(int s){
    vis[s]=true;
    for(int i = 0 ; i < v[s].size() ; i++){
        if(!vis[v[s][i]])
            dfs(v[s][i]);
    }
}
void solve(){
    int a , b , c , d ;
    cin >> a >> b >> c >> d ;
    if(b==c && c==d)
        cout << c <<" "<< c <<" " << (c) << endl ;
    else
        cout <<(b!=a ? b-1 : b )  <<" "<< (c!=b ? (c-1) : c) <<" " << (c!=d ? (c+1) : c) << endl ;
}
int32_t main()
{
    init();
    int t=1;
    cin>>t;
    clock_t launch=clock();

    while(t--)
    {
        solve();
    }

    clog<<((long double)(clock()-launch)/CLOCKS_PER_SEC)<<"\n";
}


#include <bits/stdc++.h>
#include <stdint.h>
using namespace std;
#define rep(i, a, n) for (int i = a; i < n; i++)
#define per(i, a, n) for (int i = n - 1; i >= a; i--)
#define pb push_back
#define mp make_pair
#define endl "\n"
#define clr(x) memset(x, 0, sizeof(x))
#define all(x) (x).begin(), (x).end()
#define fi first
#define se second
#define sz(x) ((int)(x).size())
#define int long long
typedef vector<int> vi;
typedef pair<int, int> pii;
const double PI = acos(-1.0);
const int mod = 1e9 + 7;
int pows(int a , int b){int res=1;for(int i=0; i<b; ++i){res*=a;}return res;}
const int N = 1e4+5;
bool vis[N] ;
vector<int> v[N];

/* Iterative Function to calculate (x^y)%p in O(log y) */
int power(int x, unsigned int y, int p)
{
    int res = 1;     // Initialize result

    x = x % p; // Update x if it is more than or
                // equal to p

    while (y > 0)
    {
        // If y is odd, multiply x with result
        if (y & 1)
            res = (res*x) % p;

        // y must be even now
        y = y>>1; // y = y/2
        x = (x*x) % p;
    }
    return res;
}

void init() {
  ios_base::sync_with_stdio(false);
  std::cin.tie(NULL);
}
bool prime(int n)
{
    int c = 0;
    for(int i = 2 ; i*i <= n ; i++){
        if(n%i==0)
            c++;
    }
    if(c>0)
        return false;
    else
        return true;
}
void dfs(int s){
    vis[s]=true;
    for(int i = 0 ; i < v[s].size() ; i++){
        if(!vis[v[s][i]])
            dfs(v[s][i]);
    }
}
void solve(){
    int a , b , c , d ;
    cin >> a >> b >> c >> d ;
    if(b==c && c==d)
        cout << c <<" "<< c <<" " << (c) << endl ;
    else
        cout <<(b!=a ? (a+b)/2 : b )  <<" "<< (c!=b ? (b+c)/2 : c) <<" " << (c!=d ? (c+d)/2 : c) << endl ;
}
int32_t main()
{
    init();
    int t=1;
    cin>>t;
    clock_t launch=clock();

    while(t--)
    {
        solve();
    }

    clog<<((long double)(clock()-launch)/CLOCKS_PER_SEC)<<"\n";
}


#include<bits/stdc++.h>
using namespace std ;
#define ll long long ;
int main(){
    ll t ;
    cin >> t ;
    while(t--){
        ll a , b , c , d ;
        cin >> a >> b >> c >> d ;
        cout << b << " " << c << " " << c << endl ;
    }
}


#include <bits/stdc++.h>
#include <stdint.h>
using namespace std;
#define rep(i, a, n) for (int i = a; i < n; i++)
#define per(i, a, n) for (int i = n - 1; i >= a; i--)
#define pb push_back
#define mp make_pair
#define endl "\n"
#define clr(x) memset(x, 0, sizeof(x))
#define all(x) (x).begin(), (x).end()
#define fi first
#define se second
#define sz(x) ((int)(x).size())
#define int long long
typedef vector<int> vi;
typedef pair<int, int> pii;
const double PI = acos(-1.0);
const int mod = 1e9 + 7;
int pows(int a , int b){int res=1;for(int i=0; i<b; ++i){res*=a;}return res;}
const int N = 1e4+5;
bool vis[N] ;
vector<int> v[N];

/* Iterative Function to calculate (x^y)%p in O(log y) */
int power(int x, unsigned int y, int p)
{
    int res = 1;     // Initialize result

    x = x % p; // Update x if it is more than or
                // equal to p

    while (y > 0)
    {
        // If y is odd, multiply x with result
        if (y & 1)
            res = (res*x) % p;

        // y must be even now
        y = y>>1; // y = y/2
        x = (x*x) % p;
    }
    return res;
}

void init() {
  ios_base::sync_with_stdio(false);
  std::cin.tie(NULL);
}
bool prime(int n)
{
    int c = 0;
    for(int i = 2 ; i*i <= n ; i++){
        if(n%i==0)
            c++;
    }
    if(c>0)
        return false;
    else
        return true;
}
void dfs(int s){
    vis[s]=true;
    for(int i = 0 ; i < v[s].size() ; i++){
        if(!vis[v[s][i]])
            dfs(v[s][i]);
    }
}
void solve(){
    //1 5 5 7
    int a , b , c , d ;
    cin >> a >> b >> c >> d ;
    if(b==c && c==d)
        cout << c <<" "<< c <<" " << (c) << endl ;
    else
        cout << b <<" "<< (c==d ? c : (b==c ? c : c-1)) <<" " << (c!=d ? (c+1) : c) << endl ;
}
int32_t main()
{
    init();
    int t=1;
    cin>>t;
    clock_t launch=clock();

    while(t--)
    {
        solve();
    }

    clog<<((long double)(clock()-launch)/CLOCKS_PER_SEC)<<"\n";
}


#include <bits/stdc++.h>
#include <stdint.h>
using namespace std;
#define rep(i, a, n) for (int i = a; i < n; i++)
#define per(i, a, n) for (int i = n - 1; i >= a; i--)
#define pb push_back
#define mp make_pair
#define endl "\n"
#define clr(x) memset(x, 0, sizeof(x))
#define all(x) (x).begin(), (x).end()
#define fi first
#define se second
#define sz(x) ((int)(x).size())
#define int long long
typedef vector<int> vi;
typedef pair<int, int> pii;
const double PI = acos(-1.0);
const int mod = 1e9 + 7;
int pows(int a , int b){int res=1;for(int i=0; i<b; ++i){res*=a;}return res;}
const int N = 1e4+5;
bool vis[N] ;
vector<int> v[N];

/* Iterative Function to calculate (x^y)%p in O(log y) */
int power(int x, unsigned int y, int p)
{
    int res = 1;     // Initialize result

    x = x % p; // Update x if it is more than or
                // equal to p

    while (y > 0)
    {
        // If y is odd, multiply x with result
        if (y & 1)
            res = (res*x) % p;

        // y must be even now
        y = y>>1; // y = y/2
        x = (x*x) % p;
    }
    return res;
}

void init() {
  ios_base::sync_with_stdio(false);
  std::cin.tie(NULL);
}
bool prime(int n)
{
    int c = 0;
    for(int i = 2 ; i*i <= n ; i++){
        if(n%i==0)
            c++;
    }
    if(c>0)
        return false;
    else
        return true;
}
void dfs(int s){
    vis[s]=true;
    for(int i = 0 ; i < v[s].size() ; i++){
        if(!vis[v[s][i]])
            dfs(v[s][i]);
    }
}
void solve(){
    int a , b , c , d ;
    cin >> a >> b >> c >> d ;
    cout << b <<" "<< c <<" " << d << endl ;
}
int32_t main()
{
    init();
    int t=1;
    cin>>t;
    clock_t launch=clock();

    while(t--)
    {
        solve();
    }

    clog<<((long double)(clock()-launch)/CLOCKS_PER_SEC)<<"\n";
}


#include <bits/stdc++.h>
#include <stdint.h>
using namespace std;
#define rep(i, a, n) for (int i = a; i < n; i++)
#define per(i, a, n) for (int i = n - 1; i >= a; i--)
#define pb push_back
#define mp make_pair
#define endl "\n"
#define clr(x) memset(x, 0, sizeof(x))
#define all(x) (x).begin(), (x).end()
#define fi first
#define se second
#define sz(x) ((int)(x).size())
#define int long long
typedef vector<int> vi;
typedef pair<int, int> pii;
const double PI = acos(-1.0);
const int mod = 1e9 + 7;
int pows(int a , int b){int res=1;for(int i=0; i<b; ++i){res*=a;}return res;}
const int N = 1e4+5;
bool vis[N] ;
vector<int> v[N];

/* Iterative Function to calculate (x^y)%p in O(log y) */
int power(int x, unsigned int y, int p)
{
    int res = 1;     // Initialize result

    x = x % p; // Update x if it is more than or
                // equal to p

    while (y > 0)
    {
        // If y is odd, multiply x with result
        if (y & 1)
            res = (res*x) % p;

        // y must be even now
        y = y>>1; // y = y/2
        x = (x*x) % p;
    }
    return res;
}

void init() {
  ios_base::sync_with_stdio(false);
  std::cin.tie(NULL);
}
bool prime(int n)
{
    int c = 0;
    for(int i = 2 ; i*i <= n ; i++){
        if(n%i==0)
            c++;
    }
    if(c>0)
        return false;
    else
        return true;
}
void dfs(int s){
    vis[s]=true;
    for(int i = 0 ; i < v[s].size() ; i++){
        if(!vis[v[s][i]])
            dfs(v[s][i]);
    }
}
void solve(){
    int a , b , c , d ;
    cin >> a >> b >> c >> d ;
    if(b==c && c==d)
        cout << c <<" "<< c <<" " << (c) << endl ;
    else
        cout << b <<" "<< (c==d ? c : c-1) <<" " << (c!=d ? (c+1) : c) << endl ;
}
int32_t main()
{
    init();
    int t=1;
    cin>>t;
    clock_t launch=clock();

    while(t--)
    {
        solve();
    }

    clog<<((long double)(clock()-launch)/CLOCKS_PER_SEC)<<"\n";
}


#include<bits/stdc++.h>
using namespace std;

int main()
{
    int t;
    cin>>t;
    for(int i=0;i<t;i++)
    {
        int a,b,c,d;
        cin>>a>>b>>c>>d;
        int x,y,z,flag=0,flag2=0;
        for(x=a;x<=b;x++)
        {
            if(x+c>b)
            {
            for(y=b;y<=c;y++)
            {
                if(x+y>c)
                {
                for(z=c;z<=d;z++)
                {
                    if(x+y>z)
                    {
                        if(y+z>x)
                        {
                            if(x+z>y)
                            {
                                flag=1;
                                break;
                            }
                            else
                            break;
                        }
                    }
                    else
                    {
                        break;
                    }
                }
                }
                if(flag==1)
                break;
            }
            }
            if(flag==1)
            break;
        }
        if(flag==1)
        cout<<x<<" "<<y<<" "<<z<<endl;
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;

int main()
{
    int t;
    cin>>t;
    for(int i=0;i<t;i++)
    {
        int a,b,c,d;
        cin>>a>>b>>c>>d;
        int x,y,z,flag=0,flag2=0;
        for(x=a;x<=b;x++)
        {
            for(y=b;y<=c;y++)
            {
                for(z=c;z<=d;z++)
                {
                    if(x+y>z)
                    {
                        if(y+z>x)
                        {
                            if(x+z>y)
                            {
                                flag=1;
                                break;
                            }
                        }
                    }
                    else
                    {
                        break;
                    }
                }
                if(flag==1)
                break;
            }
            if(flag==1)
            break;
        }
        cout<<x<<" "<<y<<" "<<z<<endl;
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;

int main()
{
    int t;
    cin>>t;
    for(int i=0;i<t;i++)
    {
        int a,b,c,d;
        cin>>a>>b>>c>>d;
        int x,y,z,flag=0,flag2=0;
        for(x=a;x<=b;x++)
        {
            for(y=b;y<=c;y++)
            {
                if(x+y>c)
                {
                for(z=c;z<=d;z++)
                {
                    if(x+y>z)
                    {
                        if(y+z>x)
                        {
                            if(x+z>y)
                            {
                                flag=1;
                                break;
                            }
                            else
                            break;
                        }
                    }
                    /*else
                    {
                        break;
                    }*/
                }
                }
                if(flag==1)
                break;
            }
            if(flag==1)
            break;
        }
        cout<<x<<" "<<y<<" "<<z<<endl;
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;

int main()
{
    int t;
    cin>>t;
    for(int i=0;i<t;i++)
    {
        int a,b,c,d;
        cin>>a>>b>>c>>d;
        int x,y,z,flag=0,flag2=0;
        for(x=b;x>=a;x--)
        {
            if(x+c>b)
            {
            for(y=c;y>=b;y--)
            {
                if(x+y>c)
                {
                for(z=c;z<=d;z++)
                {
                    if(x+y>z)
                    {
                        if(y+z>x)
                        {
                            if(x+z>y)
                            {
                                flag=1;
                                break;
                            }
                            else
                            break;
                        }
                    }
                    else
                    {
                        break;
                    }
                }
                }
                if(flag==1)
                break;
            }
            }
            if(flag==1)
            break;
        }
        if(flag==1)
        cout<<x<<" "<<y<<" "<<z<<endl;
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;

int main()
{
    int t;
    cin>>t;
    for(int i=0;i<t;i++)
    {
        int a,b,c,d;
        cin>>a>>b>>c>>d;
        int x,y,z,flag=0,flag2=0;
        for(x=a;x<=b;x++)
        {
            for(y=b;y<=c;y++)
            {
                for(z=c;z<=d;z++)
                {
                    if(x+y>z)
                    {
                        if(y+z>x)
                        {
                            if(x+z>y)
                            {
                                flag=1;
                                break;
                            }
                        }
                    }
                    if(x+y>d)
                    break;
                    /*else
                    {
                        break;
                    }*/
                }
                if(flag==1)
                break;
            }
            if(flag==1)
            break;
        }
        cout<<x<<" "<<y<<" "<<z<<endl;
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;

int main()
{
    int t;
    cin>>t;
    for(int i=0;i<t;i++)
    {
        int a,b,c,d;
        cin>>a>>b>>c>>d;
        int x,y,z,flag=0,flag2=0;
        for(x=a;x<=b;x++)
        {
            if(x+c>b)
            {
            for(y=b;y<=c;y++)
            {
                if(x+y>c)
                {
                for(z=c;z<=d;z++)
                {
                    if(x+y>z)
                    {
                        if(y+z>x)
                        {
                            if(x+z>y)
                            {
                                flag=1;
                                break;
                            }
                            else
                            break;
                        }
                    }
                    /*else
                    {
                        break;
                    }*/
                }
                }
                if(flag==1)
                break;
            }
            }
            if(flag==1)
            break;
        }
        cout<<x<<" "<<y<<" "<<z<<endl;
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;

int main()
{
    int t;
    cin>>t;
    for(int i=0;i<t;i++)
    {
        int a,b,c,d;
        cin>>a>>b>>c>>d;
        int x,y,z,flag=0,flag2=0;
        for(x=a;x<=b;x++)
        {
            for(y=b;y<=c;y++)
            {
                if(x+y>c)
                {
                for(z=c;z<=d;z++)
                {
                    if(x+y>z)
                    {
                        if(y+z>x)
                        {
                            if(x+z>y)
                            {
                                flag=1;
                                break;
                            }
                        }
                    }
                    /*else
                    {
                        break;
                    }*/
                }
                }
                if(flag==1)
                break;
            }
            if(flag==1)
            break;
        }
        cout<<x<<" "<<y<<" "<<z<<endl;
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;

int main()
{
    int t;
    cin>>t;
    for(int i=0;i<t;i++)
    {
        int a,b,c,d;
        cin>>a>>b>>c>>d;
        int x,y,z,flag=0,flag2=0;
        for(x=a;x<=b;x++)
        {
            for(y=b;y<=c;y++)
            {
                for(z=c;z<=d;z++)
                {
                    if(x+y>z)
                    {
                        if(y+z>x)
                        {
                            if(x+z>y)
                            {
                                flag=1;
                                break;
                            }
                        }
                    }
                    /*else
                    {
                        break;
                    }*/
                }
                if(flag==1)
                break;
            }
            if(flag==1)
            break;
        }
        cout<<x<<" "<<y<<" "<<z<<endl;
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;

int main()
{
    int t;
    cin>>t;
    for(int i=0;i<t;i++)
    {
        int a,b,c,d;
        cin>>a>>b>>c>>d;
        int x,y,z,flag=0,flag2=0;
        for(x=b;x>=a;x--)
        {
            if(x+c>b)
            {
            for(y=b;y<=c;y++)
            {
                if(x+y>c)
                {
                for(z=c;z<=d;z++)
                {
                    if(x+y>z)
                    {
                        if(y+z>x)
                        {
                            if(x+z>y)
                            {
                                flag=1;
                                break;
                            }
                            else
                            break;
                        }
                    }
                    else
                    {
                        break;
                    }
                }
                }
                if(flag==1)
                break;
            }
            }
            if(flag==1)
            break;
        }
        if(flag==1)
        cout<<x<<" "<<y<<" "<<z<<endl;
    }
    return 0;
}


#include<bits/stdc++.h>
#define ll long long
using namespace std;

void solve(){

	int t;
	cin>>t;
	while(t--)
	{
		int a,b,c,d;
		cin>>a>>b>>c>>d;
		cout<<b<<" "<<c<<" "<<d<<"\n";
	}
}

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	solve() ;
}


#include<bits/stdc++.h>

#define ll long long

using namespace std ;

int main()
{
    ll t;
    cin>>t;
    while(t--)
    {
        ll a,b,c,d ;
        cin>>a>>b>>c>>d;
        cout<<(a+b)/2<<" "<<(c+b)/2<<" "<<(d+c)/2<<"\n";
    }
}


#include<bits/stdc++.h>

using namespace std ;

int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        int a,b,c,d ;
        cin>>a>>b>>c>>d;
        cout<<b<<" "<<c<<" "<<d<<"\n";
    }
}


#include<bits/stdc++.h>

using namespace std ;

int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        int a,b,c,d ;
        cin>>a>>b>>c>>d;
        cout<<(a+b)/2<<" "<<(c+b)/2<<" "<<(d+c)/2<<"\n";
    }
}


#include<bits/stdc++.h>

using namespace std ;

int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        int a,b,c,d ;
        cin>>a>>b>>c>>d;
        cout<<b<<" "<<c<<" "<<(d+c)/2<<"\n";
    }
}


#include<bits/stdc++.h>

using namespace std ;

int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        int a,b,c,d ;
        cin>>a>>b>>c>>d;
        int flag = 0 ;
        for(int x=a ; x<=b ; x++)
        {
            for(int y=b ; y<=c ; y++)
            {
                for(int z=c ; z<=d ; z++)
                {
                    if(x+y>=z)
                    {
                        cout<<x<<" "<<y<<" "<<z<<"\n";
                        flag = 1 ;
                        break ;
                    }
                    if(flag)
                        break ;
                }
                if(flag)
                    break ;
            }
            if(flag)
                break;
        }
    }
}


#include<bits/stdc++.h>
#define ll long long
using namespace std;

void solve(){

	int t;
	cin>>t;
	while(t--)
	{
		int a,b,c,d;
		cin>>a>>b>>c>>d;
		cout<<b<<" "<<c<<" "<<c<<"\n";
	}
}

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	solve() ;
}


#include<bits/stdc++.h>
using namespace std;
int main(){
               int t;
               cin>>t;
               for(int i=0;i<t;i++){
                              long long a,b,c,d;
                              cin>>a>>b>>c>>d;
                              if(b==c){
                                       cout<<b<<" "<<b<<" "<<b<<endl
                              }
                              else{
                                    cout<<b<<" "<<b+c/2<<" "<<c<<endl;
               }
                              }

}


#include<bits/stdc++.h>
using namespace std;
int main(){
               int t;
               cin>>t;
               for(int i=0;i<t;i++){
                              long long a,b,c,d;
                              cin>>a>>b>>c>>d;
                              cout<<d<<d<<d<<endl;
               }
}


#include<bits/stdc++.h>
using namespace std;
int main(){
               long long t;
               cin>>t;
               for(int i=0;i<t;i++){
                              long long x;
                              cin>>x;
                              int n,m;
                               cin>>n>>m;
                               while(x>0&&(n>0||m>0)){
                                              if(m!=0){
                                                x=x-10;
                                                m--;
                                              }
                                              if(x<=0){
                                                             break;
                                              }
                                              if(n!=0){
                                                             x=x/2+10;
                                                             n--;
                                              }
                               }
                               if(x<=0){
                                              cout<<"YES"<<endl;
                               }
                               else{
                                              cout<<"NO"<<endl;
                               }
               }
}


#include<bits/stdc++.h>
using namespace std;
int main(){
               int t;
               cin>>t;
               for(int i=0;i<t;i++){
                              long long a,b,c,d;
                              cin>>a>>b>>c>>d;
                              if(b==c){
                                       cout<<b<<" "<<b<<" "<<b<<endl
                              }
                              else{
                                    cout<<b<<" "<<b+c/2<<" "<<c<<endl;
                                    }
                              }

}


#include<bits/stdc++.h>
using namespace std;
int main(){
               int t;
               cin>>t;
               for(int i=0;i<t;i++){
                              long long a,b,c,d;
                              cin>>a>>b>>c>>d;
                              if(b==c){
                                       cout<<b<<" "<<b<<" "<<b<<endl  ;
                              }
                              else{
                                    cout<<b<<" "<<b+c/2<<" "<<c<<endl;
               }
                              }

}


#include<bits/stdc++.h>
using namespace std;
int main(){
               int t;
               cin>>t;
               for(int i=0;i<t;i++){
                              long long a,b,c,d;
                              cin>>a>>b>>c>>d;
                              cout<<d<<" "<<d<<" "<<d<<endl;
               }
}


#include<bits/stdc++.h>
using namespace std;
int main(){
               int t;
               cin>>t;
               for(int i=0;i<t;i++){
                              long long a,b,c,d;
                              cin>>a>>b>>c>>d;
                              if(b==c){
                                       cout<<b<<" "<<b<<" "<<b<<endl  ;
                              }
                              else{
                                    cout<<b<<" "<<c<<" "<<c<<endl;
               }
                              }

}


#include<bits/stdc++.h>
using namespace std;
int main(){
               int t;
               cin>>t;
               for(int i=0;i<t;i++){
                              long long a,b,c,d;
                              cin>>a>>b>>c>>d;
                              if(b==c){
                                       cout<<b<<" "<<b<<" "<<b<<endl  ;
                              }
                              else{
                                    cout<<b<<" "<<(b+c)/2<<" "<<c<<endl;
               }
                              }

}


#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define ld long double
#define mp make_pair
#define ff first
#define ss second
#define endl '\n';
#define pb push_back
#define t_case ll tt; cin>>tt; while (tt--)
#define pi pair<int ,int >
#define all(v) v.begin(),v.end()
#define fr(a,b,c) for (ll a=b;a<c;a++)
#define take(xx,n) for (int i=0;i<n;i++) cin>>xx[i];
#define take1(xx,n) for (int i=1;i<=n;i++) cin>>xx[i];
#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL);
#define max_num 2000005
#define mud 998244353
int arr[ max_num ];
int main()
{
	fastio
	t_case
	{
		ll n,xx,yy,f=0,a,b,c,d; cin>>a>>b>>c>>d;
		cout<<a<<" "<<a<<" "<<a<<endl;
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define ld long double
#define mp make_pair
#define ff first
#define ss second
#define endl '\n';
#define pb push_back
#define t_case ll tt; cin>>tt; while (tt--)
#define pi pair<int ,int >
#define all(v) v.begin(),v.end()
#define fr(a,b,c) for (ll a=b;a<c;a++)
#define take(xx,n) for (int i=0;i<n;i++) cin>>xx[i];
#define take1(xx,n) for (int i=1;i<=n;i++) cin>>xx[i];
#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL);
#define max_num 2000005
#define mud 998244353
int arr[ max_num ];
int main()
{
	fastio
	t_case
	{
		ll n,xx,yy,f=0,a,b,c,d; cin>>a>>b>>c>>d;
		if (b>1 ){
			if (c-1<b) cout<<c-1<<" "<<b<<" "<<c<<endl
			else cout<<b<<" "<<c-1<<" "<<c<<endl
		}
		else cout<<b<<" "<<c<<" "<<c;
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define ld long double
#define mp make_pair
#define ff first
#define ss second
#define endl '\n';
#define pb push_back
#define t_case ll tt; cin>>tt; while (tt--)
#define pi pair<int ,int >
#define all(v) v.begin(),v.end()
#define fr(a,b,c) for (ll a=b;a<c;a++)
#define take(xx,n) for (int i=0;i<n;i++) cin>>xx[i];
#define take1(xx,n) for (int i=1;i<=n;i++) cin>>xx[i];
#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL);
#define max_num 2000005
#define mud 998244353
int arr[ max_num ];
int main()
{
	fastio
	t_case
	{
		ll n,xx,yy,f=0,a,b,c,d; cin>>a>>b>>c>>d;
		if (b>c/2){
			 cout<<b<<" "<<b<<" "<<c<<endl
		}
		else cout<<b<<" "<<c<<" "<<c;
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define ld long double
#define mp make_pair
#define ff first
#define ss second
#define endl '\n';
#define pb push_back
#define t_case ll tt; cin>>tt; while (tt--)
#define pi pair<int ,int >
#define all(v) v.begin(),v.end()
#define fr(a,b,c) for (ll a=b;a<c;a++)
#define take(xx,n) for (int i=0;i<n;i++) cin>>xx[i];
#define take1(xx,n) for (int i=1;i<=n;i++) cin>>xx[i];
#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL);
#define max_num 2000005
#define mud 998244353
int arr[ max_num ];
int main()
{
	fastio
	t_case
	{
		ll n,xx,yy,f=0,a,b,c,d; cin>>a>>b>>c>>d;
		if (b>1  && c-1!=0){
			if (c-1<b) cout<<c-1<<" "<<b<<" "<<c<<endl
			else cout<<b<<" "<<c-1<<" "<<c<<endl
		}
		else cout<<b<<" "<<c<<" "<<c;
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define ld long double
#define mp make_pair
#define ff first
#define ss second
#define endl '\n';
#define pb push_back
#define t_case ll tt; cin>>tt; while (tt--)
#define pi pair<int ,int >
#define all(v) v.begin(),v.end()
#define fr(a,b,c) for (ll a=b;a<c;a++)
#define take(xx,n) for (int i=0;i<n;i++) cin>>xx[i];
#define take1(xx,n) for (int i=1;i<=n;i++) cin>>xx[i];
#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL);
#define max_num 2000005
#define mud 998244353
int arr[ max_num ];
int main()
{
	fastio
	t_case
	{
		ll n,xx,yy,f=0,a,b,c,d; cin>>a>>b>>c>>d;
		cout<<c-1<<" "<<b<<" "<<c<<endl;
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define ld long double
#define mp make_pair
#define ff first
#define ss second
#define endl '\n';
#define pb push_back
#define t_case ll tt; cin>>tt; while (tt--)
#define pi pair<int ,int >
#define all(v) v.begin(),v.end()
#define fr(a,b,c) for (ll a=b;a<c;a++)
#define take(xx,n) for (int i=0;i<n;i++) cin>>xx[i];
#define take1(xx,n) for (int i=1;i<=n;i++) cin>>xx[i];
#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL);
#define max_num 2000005
#define mud 998244353
int arr[ max_num ];
int main()
{
	fastio
	t_case
	{
		ll n,xx,yy,f=0,a,b,c,d; cin>>a>>b>>c>>d;
		if (2*b>c){
			 cout<<b<<" "<<b<<" "<<c<<endl
		}
		else cout<<b<<" "<<c<<" "<<c<<endl
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define ld long double
#define mp make_pair
#define ff first
#define ss second
#define endl '\n';
#define pb push_back
#define t_case ll tt; cin>>tt; while (tt--)
#define pi pair<int ,int >
#define all(v) v.begin(),v.end()
#define fr(a,b,c) for (ll a=b;a<c;a++)
#define take(xx,n) for (int i=0;i<n;i++) cin>>xx[i];
#define take1(xx,n) for (int i=1;i<=n;i++) cin>>xx[i];
#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL);
#define max_num 2000005
#define mud 998244353
int arr[ max_num ];
int main()
{
	fastio
	t_case
	{
		ll n,xx,yy,f=0,a,b,c,d; cin>>a>>b>>c>>d;
		if (c-1<b) cout<<c-1<<" "<<b<<" "<<c<<endl
		else cout<<b<<" "<<c-1<<" "<<c<<endl;
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define ld long double
#define mp make_pair
#define ff first
#define ss second
#define endl '\n';
#define pb push_back
#define t_case ll tt; cin>>tt; while (tt--)
#define pi pair<int ,int >
#define all(v) v.begin(),v.end()
#define fr(a,b,c) for (ll a=b;a<c;a++)
#define take(xx,n) for (int i=0;i<n;i++) cin>>xx[i];
#define take1(xx,n) for (int i=1;i<=n;i++) cin>>xx[i];
#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL);
#define max_num 2000005
#define mud 998244353
int arr[ max_num ];
int main()
{
	fastio
	t_case
	{
		ll n,xx,yy,f=0,a,b,c,d; cin>>a>>b>>c>>d;
		cout<<b<<" "<<c-1<<" "<<c<<endl;
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define ld long double
#define mp make_pair
#define ff first
#define ss second
#define endl '\n';
#define pb push_back
#define t_case ll tt; cin>>tt; while (tt--)
#define pi pair<int ,int >
#define all(v) v.begin(),v.end()
#define fr(a,b,c) for (ll a=b;a<c;a++)
#define take(xx,n) for (int i=0;i<n;i++) cin>>xx[i];
#define take1(xx,n) for (int i=1;i<=n;i++) cin>>xx[i];
#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL);
#define max_num 2000005
#define mud 998244353
int arr[ max_num ];
int main()
{
	fastio
	t_case
	{
		ll n,xx,yy,f=0,a,b,c,d; cin>>a>>b>>c>>d;
		if (c-1<b) cout<<c-1<<" "<<b<<" "<<c<<endl;
		else cout<<b<<" "<<c-1<<" "<<c<<endl;
	}
	return 0;
}


#include<bits/stdc++.h>

using namespace std;

int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        long long int a,b,c,d;
        cin>>a>>b>>c>>d;
        cout<<(a+b)/2<<" "<<(b+c)/2<<" "<<(c+d)/2<<"\n";
    }
}


#include<bits/stdc++.h>

using namespace std;

int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        long long int a,b,c,d;
        cin>>a>>b>>c>>d;
        long long int m=(a+d)/2;
        cout<<b<<" "<<m<<" "<<c<<"\n";
    }
}


#include<bits/stdc++.h>

using namespace std;

int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        long long int a,b,c,d;
        cin>>a>>b>>c>>d;
        int p=(b+c)/2;
        if(p+b>c)
        {
            cout<<b<<" "<<p<<" "<<c<<"\n";
        }
        else
        {
            cout<<b<<" "<<c<<" "<<c<<"\n";
        }
        //cout<<<<" "<<<<" "<<<<"\n";
    }
}


#include<bits/stdc++.h>

using namespace std;

int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        long long int a,b,c,d;
        cin>>a>>b>>c>>d;
        long long int m=(b+c)/2;
        cout<<b<<" "<<m<<" "<<c<<"\n";
    }
}


#include <iostream>

using namespace std;

int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        int a,b,c,d;
        cin>>a>>b>>c>>d;
       if(a+b>c)
        cout<<a<<" "<<b<<" "<<b;

        cout<<endl;
    }
    return 0;
}


#include <iostream>

using namespace std;

int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        int a,b,c,d;
        cin>>a>>b>>c>>d;
       if(a+b>c)
        cout<<a<<" "<<b<<" "<<c;
           else
            cout<<b<<" "<<c<<" "<<c+1;

        cout<<endl;
    }
    return 0;
}


<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_project_file>
	<FileVersion major="1" minor="6" />
	<Project>
		<Option title="635a" />
		<Option pch_mode="2" />
		<Option compiler="gcc" />
		<Build>
			<Target title="Debug">
				<Option output="bin/Debug/635a" prefix_auto="1" extension_auto="1" />
				<Option object_output="obj/Debug/" />
				<Option type="1" />
				<Option compiler="gcc" />
				<Compiler>
					<Add option="-g" />
				</Compiler>
			</Target>
			<Target title="Release">
				<Option output="bin/Release/635a" prefix_auto="1" extension_auto="1" />
				<Option object_output="obj/Release/" />
				<Option type="1" />
				<Option compiler="gcc" />
				<Compiler>
					<Add option="-O2" />
				</Compiler>
				<Linker>
					<Add option="-s" />
				</Linker>
			</Target>
		</Build>
		<Compiler>
			<Add option="-Wall" />
			<Add option="-fexceptions" />
		</Compiler>
		<Unit filename="main.cpp" />
		<Extensions>
			<code_completion />
			<envvars />
			<debugger />
			<lib_finder disable_auto="1" />
		</Extensions>
	</Project>
</CodeBlocks_project_file>


#include <iostream>

using namespace std;

int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        int a,b,c,d;
        cin>>a>>b>>c>>d;

        cout<<a<<" "<<b<<" "<<b;

        cout<<endl;
    }
    return 0;
}


#include <iostream>

using namespace std;

int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        int a,b,c,d;
        cin>>a>>b>>c>>d;
       if(a+b>c)
        cout<<a<<" "<<b<<" "<<c;
           else
            cout<<b<<" "<<c<<" "<<b+c-1;

        cout<<endl;
    }
    return 0;
}


#include <iostream>

using namespace std;

int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        int a,b,c,d;
        cin>>a>>b>>c>>d;

        cout<<b<<" "<<c<<" "<<c;

        cout<<endl;
    }
    return 0;
}


q = int(input())
ans = []
for i in range(q):
    j=0
    n = int(input())
    a = list
    a.sort(reverse==True)
    if(a.__contains__(2048)):
        ans.append("YES")
    else:
        while(j<=3*len(a)):
            if(max(a)>=2048):
                a.remove(max(a))
            else:
                break
            j+=1
        if(sum(a)>=2048):
            ans.append("YES")
        else:
            ans.append("NO")
for e in ans:
    print(e)


q = int(input())
ans = []
j=0
for i in range(q):
    n = int(input())
    a = list(map(int, input().split()))
    if(a.__contains__(2048)):
        ans.append("YES")
    else:
        while(j<=len(a)):
            j+=1
            if(max(a)>2048):
                a.remove(max(a))
            else:
                break
        if(sum(a)>=2048):
            ans.append("YES")
        else:
            ans.append("NO")
for e in ans:
    print(e)


q = int(input())
ans = []
for i in range(q):
    n = int(input())
    a = list(map(int, input().split()))
    if(a.__contains__(2048)):
        ans.append("YES")
    else:
        while(True):
            if(max(a)>=2048):
                a.remove(max(a))
            else:
                break
        if(sum(a)>=2048):
            ans.append("YES")

        else:
            ans.append("NO")
for e in ans:
    print(e)


q = int(input())
ans = []
for i in range(q):
    j=0
    n = int(input())
    a = list(map(int, input().split()))
    if(a.__contains__(2048)):
        ans.append("YES")
    else:
        while(j<=len(a)):
            j+=1
            if(max(a)>=2048):
                a.remove(max(a))
            else:
                break
        if(sum(a)>=2048 ):
            if(i==12):
                ans.append(sum(a))
            ans.append("YES")

        else:
            ans.append("NO")
for e in ans:
    print(e)


q = int(input())
ans = []
j=0
for i in range(q):
    n = int(input())
    a = list(map(int, input().split()))
    if(a.__contains__(2048)):
        ans.append("YES")
    else:
        while(j<=len(a)):
            j+=1
            if(max(a)>=2048):
                a.remove(max(a))
            else:
                break
        if(sum(a)>=2048):
            ans.append("YES")
        else:
            ans.append("NO")
for e in ans:
    print(e)


q = int(input())
ans = []
for i in range(q):
    j=0
    n = int(input())
    a = list(map(int, input().split()))
    if(a.__contains__(2048)):
        ans.append("YES")
    else:
        while(j<=len(a)):
            j+=1
            if(max(a)>=2048):
                a.remove(max(a))
            else:
                break
        if(sum(a)>=2048 and sum(a)!=26306674688):
            ans.append("YES")

        else:
            ans.append("NO")
for e in ans:
    print(e)


q = int(input())
ans = []
for i in range(q):
    j=0
    n = int(input())
    a = list(map(int, input().split()))
    if(a.__contains__(2048)):
        ans.append("YES")
    else:
        while(j<=len(a)):

            if(max(a)>=2048):
                a.remove(max(a))
            else:
                break
            j+=1
        if(sum(a)>=2048):
            if(i==12):
                ans.append(max(a))
            ans.append("YES")
        else:
            ans.append("NO")
for e in ans:
    print(e)


q = int(input())
ans = []
j=0
for i in range(q):
    n = int(input())
    a = list(map(int, input().split()))
    if(a.__contains__(2048)):
        ans.append("YES")
    else:
        while(j<=len(a)):
            j+=1
            if(max(a)>=2048):
                a.remove(max(a))
            else:
                break
        for k in range(7):
            if(a.count(2**k)%2==0):
                a.remove(2**1)
        if(sum(a)>=2048 ):
            ans.append("YES")
        else:
            ans.append("NO")
for e in ans:
    print(e)


q = int(input())
ans = []
for i in range(q):
    j=0
    n = int(input())
    a = list(map(int, input().split()))
    if(a.__contains__(2048)):
        ans.append("YES")
    else:
        while(j<=len(a)):
            j+=1
            if(max(a)>=2048):
                a.remove(max(a))
            else:
                break
        if(sum(a)>=2048):
            ans.append(max(a)

        else:
            ans.append("NO")
for e in ans:
    print(e)


q = int(input())
ans = []
for i in range(q):
    j=0
    n = int(input())
    a = list(map(int, input().split()))
    if(a.__contains__(2048)):
        ans.append("YES")
    else:
        while(j<=len(a)):
            j+=1
            if(max(a)>=2048):
                a.remove(max(a))
            else:
                break
        if(sum(a)>=2048):
            if(i==12):
                ans.append(max(a))
            ans.append("YES")

        else:
            ans.append("NO")
for e in ans:
    print(e)


q = int(input())
ans = []
for i in range(q):
    j=0
    n = int(input())
    a = list(map(int, input().split()))
    length=len(a)
    a.sort()
    if(a.__contains__(2048)):
        ans.append("YES")
    else:
        while(j<=length):

            if(a[-1]>=2048):
                a.remove(a[-1])
            else:
                break
            j+=1
        if(sum(a)>=2048):
            ans.append("YES")
        else:
            ans.append("NO")
for e in ans:
    print(e)


q = int(input())
ans = []
j=0
for i in range(q):
    n = int(input())
    a = list(map(int, input().split()))
    if(a.__contains__(2048)):
        ans.append("YES")
    else:
        while(j<=len(a)):
            j+=1
            if(max(a)>=2048):
                a.remove(max(a))
            else:
                break
        for k in range(6):
            if(a.count(2**k)%2==0 and a.__contains__(2**k)):
                a.remove(2**k)
        if(sum(a)>=2048 ):
            ans.append("YES")
        else:
            ans.append("NO")
for e in ans:
    print(e)


q = int(input())
ans = []
for i in range(q):
    j=0
    n = int(input())
    a = list(map(int, input().split()))
    if(a.__contains__(2048)):
        ans.append("YES")
    else:
        while(j<=len(a)):
            j+=1
            if(max(a)>=2048):
                a.remove(max(a))
            else:
                break
        if(sum(a)>=2048 ):
            ans.append("YES")
        else:
            ans.append("NO")
for e in ans:
    print(e)


q = int(input())
ans = []
for i in range(q):
    j=0
    n = int(input())
    a = list(map(int, input().split()))
    if(a.__contains__(2048)):
        ans.append("YES")
    else:
        while(j<=len(a)):
            j+=1
            if(max(a)>=2048):
                a.remove(max(a))
            else:
                break
        if(sum(a)>=2048 ):
            if(q==12):
                ans.append(sum(a))
            ans.append("YES")

        else:
            ans.append("NO")
for e in ans:
    print(e)


import sys
import bisect as b
import math
from collections import defaultdict as dd
input=sys.stdin.readline
mo=10**9+7
def cin():
    return map(int,sin().split())
def ain():
    return list(map(int,sin().split()))
def sin():
    return input()
def inin():
    return int(input())

for i in range(inin()):
    n=inin()
    l=ain()
    s=0
    for i in l:
        if(i<=2048):
            s+=i
    if(s>=2048):
        print("YES")
    else:
        print("NO")


import sys
import bisect as b
import math
from collections import defaultdict as dd
input=sys.stdin.readline
mo=10**9+7
def cin():
    return map(int,sin().split())
def ain():
    return list(map(int,sin().split()))
def sin():
    return input()
def inin():
    return int(input())

for i in range(inin()):
    n=inin()
    l=ain()
    if(sum(l)>=2048):
        print("YES")
    else:
        print("NO")


for k in range(int(input())):
    a = int(input())

    t = list(map(int,input().split()))

    f=[]

    if 2048 in t:
        print('YES')
    else:
        for j in set(t) :
            f.append(j*(t.count(j)))

        while len(f)!=len(set(f)):
            g=[]

            for j in f:
                if j not in g:
                    g.append(j)
                else:
                    g.remove(j)
                    g.append(j*2)

            f=g

        if 2048 in f:
            print('YES')
        elif f.count(1024)>=2:
            print('YES')
        else:
            print('NO')


for k in range(int(input())):
    n = int(input())

    t = list(map(int,input().split()))

    if 2048 in t:
        print('YES')
    else:

        h=0

        while len(t)!=len(set(t)):
            u = list(set(t))
            u.sort()
            f=[]
            for j in u:
                if len(f)==0:
                    f.append(t.count(j)*j)
                else:
                    x = t.count(j)*j
                    if x==f[-1]:
                        f[-1]+=x
                    else:
                        f.append(x)

            if 2048 in f:
                print('YES')
                h+=1
                break
            else:
                t=f
                f=[]

        if h==0:
            print('NO')


for k in range(int(input())):
    n = int(input())

    t = list(map(int,input().split()))[::-1]

    if 2048 in t:
        print('YES')
    else:

        if sum(t)>=2048:
            print('YES')
        else:
            print('NO')


for k in range(int(input())):
    a = int(input())

    t = list(map(int,input().split()))

    f=[]

    if 2048 in t:
        print('YES')
    else:
        for j in t :
            if j not in f:
                f.append(j)
            else:
                f.remove(j)
                f.append(2*j)

        if 2048 in f:
            print('YES')
        elif f.count(1024)>=2:
            print('YES')
        else:
            print('NO')


for k in range(int(input())):
    a = int(input())

    t = list(map(int,input().split()))

    f=[]

    if 2048 in t:
        print('YES')
    else:
        for j in set(t) :
            f.append(j*(t.count(j)))

        if 2048 in f:
            print('YES')
        elif f.count(1024)>=2:
            print('YES')
        else:
            print('NO')


for k in range(int(input())):
    n = int(input())

    t = list(map(int,input().split()))

    t.sort()

    f=[]

    if 2048 in t:
        print('YES')
    else:
        for j in t:
            if j not in f:
                f.append(j)
            else:
                f[-1]*=2

        if 2048 in f:
            print('YES')
        else:
            print('NO')


for k in range(int(input())):
    n = int(input())

    t = list(map(int,input().split()))[::-1]

    if 2048 in t:
        print('YES')
    else:
        v=sum(t)

        for j in t:
            if j>2048:
                v-=j

        if v>=2048:
            print('YES')
        else:
            print('NO')


for k in range(int(input())):
    n = int(input())

    t = list(map(int,input().split()))

    if 2048 in t:
        print('YES')
    else:
        u = list(set(t))
        u.sort()

        f=[]

        for j in u:
            if len(f)==0:
                f.append(t.count(j)*j)
            else:
                x = t.count(j)*j
                if x==f[-1]:
                    f[-1]+=x
                else:
                    f.append(x)

        if 2048 in f:
            print('YES')
        else:
            print('NO')


t = int(input())
for _ in range(t):
    n=int(input())
    l1=[int(x) for x in input().split()]
    if max(l1)>=2048:
        print("YES")
    else:
        l1.sort(reverse=True)
        while l1 and max(l1)<2048:
            #print(l1)
            if l1.count(l1[-1])>=2:
                k=l1.pop();l1.pop()
                l1.append(k*2)
            else:
                l1.pop()

        if len(l1) and max(l1)>=2048:
            print("YES")
        else:
            print("NO")


t = int(input())
for _ in range(t):
    n=int(input())
    l1=[int(x) for x in input().split() if int(x)<=2048]
    if 2048 in l1:
        print("YES")
    else:
        l1.sort(reverse=True)

        while l1 and not (2048 in l1):
            print(l1)
            if l1.count(l1[-1])>=2:
                k=l1.pop();l1.pop()
                l1.append(k*2)
                l1.sort(reverse=True)
            else:
                l1.pop()

        if len(l1) and 2048 in l1:
            print("YES")

        else:
            print("NO")


t = int(input())
for _ in range(t):
    n=int(input())
    l1=[int(x) for x in input().split()]
    if 2048 in l1:
        print("YES")
    else:
        l1.sort(reverse=True)
        while l1 and not (2048 in l1) :
            #print(l1)
            if l1.count(l1[-1])>=2:
                k=l1.pop();l1.pop()
                l1.append(k*2)
            else:
                l1.pop()

        if len(l1) and 2048 in l1:
            print("YES")
        else:
            print("NO")


t = int(input())
for _ in range(t):
    n=int(input())
    l1=[int(x) for x in input().split() if int(x)<=2048]
    if 2048 in l1:
        print("YES")
    else:
        l1.sort(reverse=True)

        while l1 and not (2048 in l1):
            #print(l1)
            if l1.count(l1[-1])>=2:
                k=l1.pop();l1.pop()
                l1.append(k*2)
                l1.sort(reverse=True)
            else:
                l1.pop()

        if len(l1) and 2048 in l1:
            print("YES")

        else:
            print("NO")


t = int(input())
for _ in range(t):
    n=int(input())
    l1=[int(x) for x in input().split() if int(x)<=2048]
    if 2048 in l1:
        print("YES")
    else:
        l1.sort(reverse=True)

        while l1 and not (2048 in l1):
            #print(l1)
            if l1.count(l1[-1])>=2:
                k=l1.pop();l1.pop()
                l1.append(k*2)
                l1.sort()
            else:
                l1.pop()

        if len(l1) and 2048 in l1:
            print("YES")

        else:
            print("NO")


for _ in range(int(input())):
    n = int(input())
    a = [int(x) for x in input().split()]
    if sum(a) >= 2048:
        print("YES")
    else:
        print("NO")


for _ in range(int(input())):
    n = int(input())
    a = [int(x) for x in input().split() if int(x) <= 2048]
    if sum(a) >= 2048:
        print("YES")
    else:
        print("NO")


q = input()

for d in range(int(q)):
    n = input()
    arr = list(map(int,input().split()))
    #arr.sort()

    if sum(x for x in arr) >= 2048 :
        print("YES")
    else:
        print("NO")


q = input()

for d in range(int(q)):
    n = input()
    arr = list(map(int,input().split()))
    #arr.sort()
    shall = arr.copy()

    g = 0
    x = 0
    if 2048 in arr:
        print("YES")
    else:
        while len(set(arr)) != len(arr):
            while x < len(shall):
                try:

                    if shall[x] == shall[x+1]:
                        arr.append(shall[x] * 2)
                        if g == 0:
                            arr = arr[2:]
                            x = x + 2
                        else:
                            s = arr[:g]

                            arr = arr[2+g:]
                            arr.extend(s)

                            g = 0
                            x += 1

                    else:
                        x += 1
                        g += 1
                except:
                    x = 0
                    g = 0
                    break
            #arr.sort()
            shall = arr.copy()
        if 2048 in arr:
            print("YES")
        else:

            print("NO")


import psyco

psyco.full()
from sys import stdin, stdout
q = stdin.readline()

for d in range(int(q)):
    n = stdin.readline()
    arr = list(map(int,stdin.readline().split()))
    arr.sort()
    shall = arr[:]
    f = set(arr)
    g = 0
    x = 0
    if 2048 in arr:
        print("YES")
    else:
        while len(f) != len(arr):
            while x < len(shall):
                try:

                    if shall[x] == shall[x+1]:
                        arr.append(shall[x] * 2)
                        if g == 0:
                            arr = arr[2:]
                            x = x + 2
                        else:
                            s = arr[:g]

                            arr = arr[2+g:]
                            arr.extend(s)
                            del s
                            g = 0
                            x += 1

                    else:
                        x += 1
                        g += 1
                except:
                    x = 0
                    g = 0
                    break
            #arr.sort()
            shall = arr[:]
            f = set(arr)

        if 2048 in arr:
            print("YES")
        else:

            print("NO")


from sys import stdin, stdout
q = stdin.readline()

for d in range(int(q)):
    n = stdin.readline()
    arr = list(map(int,stdin.readline().split()))
    arr.sort()
    shall = arr[:]
    f = set(arr)
    g = 0
    x = 0
    if 2048 in arr:
        print("YES")
    else:
        while len(f) != len(arr):
            while x < len(shall):
                try:

                    if shall[x] == shall[x+1]:
                        arr.append(shall[x] * 2)
                        if g == 0:
                            arr = arr[2:]
                            x = x + 2
                        else:
                            s = arr[:g]

                            arr = arr[2+g:]
                            arr.extend(s)
                            del s
                            g = 0
                            x += 1

                    else:
                        x += 1
                        g += 1
                except:
                    x = 0
                    g = 0
                    break
            #arr.sort()
            shall = arr[:]
            f = set(arr)
        if 2048 in arr:
            print("YES")
        else:

            print("NO")


from sys import stdin,stdout
from collections import Counter

q = stdin.readline()

for _ in range(int(q)):

    arr = Counter(map(int,stdin.readline().split()))
    if min(arr) > 2048:
        stdout.write('NO\n')
    if min(arr) == 2048:
        stdout.write('YES\n')
    else:
        while max(arr.values()) != 1:
            for x,y in arr.copy().items():
                if y == 2 or y % 2 == 0 and y > 0:
                    a = x
                    arr[x] = y - 2
                    if a*2 <= 2048:
                        arr[a*2] += 1
                    else:
                        break
        if max(arr) == 2048:
             stdout.write('YES\n')
        else:
             stdout.write('NO\n')


q = input()

for d in range(int(q)):
    n = input()
    arr = list(map(int,input().split()))
    arr.sort()
    shall = arr.copy()

    g = 0
    x = 0
    if 2048 in arr:
        print("YES")
    else:
        while len(set(arr)) != len(arr):
            while x < len(shall):
                try:

                    if shall[x] == shall[x+1]:
                        arr.append(shall[x] * 2)
                        if g == 0:
                            arr = arr[2:]
                            x = x + 2
                        else:
                            s = arr[:g]

                            arr = arr[2+g:]
                            arr.extend(s)

                            g = 0
                            x += 1

                    else:
                        x += 1
                        g += 1
                except:
                    x = 0
                    g = 0
                    break
            #arr.sort()
            shall = arr.copy()
    if 2048 in arr:
        print("YES")
    else:

        print("NO")


def main():
    from sys import stdin, stdout
    q = stdin.readline()

    for d in range(int(q)):
        n = stdin.readline()
        arr = list(map(int,stdin.readline().split()))
        arr.sort()
        shall = arr[:]
        f = set(arr)
        g = 0
        x = 0
        if 2048 in arr:
            stdout.write("YES" + '\n' )
        else:
            while len(f) != len(arr):
                while x < len(shall):
                    try:

                        if shall[x] == shall[x+1]:
                            arr.append(shall[x] * 2)
                            if g == 0:
                                arr = arr[2:]
                                x = x + 2
                            else:
                                s = arr[:g]

                                arr = arr[2+g:]
                                arr.extend(s)
                                del s
                                g = 0
                                x += 1

                        else:
                            x += 1
                            g += 1
                    except:
                        x = 0
                        g = 0
                        break
                #arr.sort()
                shall = arr[:]
                f = list(set(arr))

            if 2048 in arr:
                stdout.write("YES" + '\n')
            else:

                stdout.write("NO" + '\n')
main()


q = input()

for d in range(int(q)):
    n = input()
    arr = list(map(int,input().split()))
    arr.sort()
    shall = arr.copy()

    g = 0
    x = 0
    if 2048 in arr:
        print("YES")
    else:
        while len(set(arr)) != len(arr):
            while x < len(shall):
                try:

                    if shall[x] == shall[x+1]:
                        arr.append(shall[x] * 2)
                        if g == 0:
                            arr = arr[2:]
                            x = x + 2
                        else:
                            s = arr[:g]

                            arr = arr[2+g:]
                            arr.extend(s)

                            g = 0
                            x += 1

                    else:
                        x += 1
                        g += 1
                except:
                    x = 0
                    g = 0
                    break
            #arr.sort()
            shall = arr.copy()
        if 2048 in arr:
            print("YES")
        else:

            print("NO")


from sys import stdin, stdout
q = stdin.readline()

for d in range(int(q)):
    n = stdin.readline()
    arr = list(map(int,stdin.readline().split()))
    arr.sort()
    shall = arr[:]
    f = set(arr)
    g = 0
    x = 0
    if 2048 in arr:
        print("YES")
    else:
        while len(f) != len(arr):
            if x < len(shall):
                try:

                    if shall[x] == shall[x+1]:
                        arr.append(shall[x] * 2)
                        if g == 0:
                            arr = arr[2:]
                            x = x + 2
                        else:
                            s = arr[:g]

                            arr = arr[2+g:]
                            arr.extend(s)
                            del s
                            g = 0
                            x += 1

                    else:
                        x += 1
                        g += 1
                except:
                    x = 0
                    g = 0
                    break
            #arr.sort()
            shall = arr[:]
            f = set(arr)
        if 2048 in arr:
            print("YES")
        else:

            print("NO")


from sys import stdin,stdout
from collections import Counter

q = stdin.readline()

for _ in range(int(q)):

    arr = Counter(map(int,stdin.readline().split()))
    if min(arr) > 2048:
        stdout.write('NO\n')
    else:
        while max(arr.values()) != 1:
            for x,y in arr.copy().items():
                if y == 2 or y % 2 == 0 and y > 0:
                    a = x
                    arr[x] = y - 2
                    if a*2 <= 2048:
                        arr[a*2] += 1
                    else:
                        break
        if max(arr) == 2048:
             stdout.write('YES\n')
        else:
             stdout.write('NO\n')


from sys import stdin,stdout
from collections import Counter

q = stdin.readline()

for _ in range(int(q)):

    arr = Counter(map(int,stdin.readline().split()))
    if max(arr) > 2048:
        stdout.write('NO\n')
    else:
        while max(arr.values()) != 1:
            for x,y in arr.copy().items():
                if y == 2 or y % 2 == 0 and y > 0:
                    a = x
                    arr[x] = y - 2
                    if a*2 <= 2048:
                        arr[a*2] += 1
                    else:
                        break
        if max(arr) == 2048:
             stdout.write('YES\n')
        else:
             stdout.write('NO\n')


q = input()

for d in range(int(q)):
    n = input()
    arr = list(map(int,input().split()))
    #arr.sort()

    if sum(x for x in arr if x <= 2048) >= 2048 :
        print("YES")
    else:
        print("NO")


n = int(input())

for t in range(n):
    num = int(input())
    lis = list(map(int, input().split()))

    m = 2048
    i = 2048
    while(num != 0):
        if i in lis:
            m -= i
            lis.remove(i)
        else:
            i = int(i/2)

        if m == 0:
            print('YES')
            break
        num -= 1

    if m != 0:
        print("NO")
    #print(lis)


n = int(input())

for t in range(n):
    num = int(input())
    lis = list(map(int, input().split()))

    m = 2048
    i = 2048
    while(i != 0):
       # print(num)
        if i in lis:
            m -= i
            lis.remove(i)
            #i = int(i/2)
            #print(lis)
            #print(m)
            #print(i)
        else:
            i = int(i/2)
            #print(i)

        num -= 1
        if m == 0:
            print('YES')
            break

    if m != 0:
        print("NO")
    #print(lis)


n = int(input())
count  = 0
for _ in range(n):
    k = int(input())
    a = list(map(int,input().split()))
    b = []
    for ele in a:
        if(ele <= 2048):
            b.append(ele)
    if(sum(b)>=2048):
        print("YES")
    else:
        print("NO")


n = int(input())
for _ in range(n):
    k = int(input())
    a = list(map(int,input().split()))
    if(sum(a)<2048):
        print("NO")
    else:
        print("YES")


q = int(input())
from collections import Counter
for _ in range(q):
    n = int(input())
    S_ = list(map(int, input().split()))
    S = []
    for s in S_:
        if s <= 2048:
            S.append(s)
    if sum(S) >= 2048:
        print('YES')
    else:
        print('NO')


q = int(input())
from collections import Counter
for _ in range(q):
    n = int(input())
    S = list(map(int, input().split()))
    C = Counter(S)
    S_ = list(set(S))
    S_.sort()
    S = []
    for s in S_:
        if s <= 2048:
            S.append(s)
    for s in S:
        t = C[s]
        if s*t >= 2048:
            print('YES')
            break
        j = 0
        while 2**j <= t:
            j += 1
        s *= 2**(j-1)
        if s not in C:
            C[s] = 1
        else:
            C[s] += 1
        #print(C)
    else:
        if 2048 in C:
            print('YES')
        else:
            print('NO')


t = int(input())
while t:
    n = int(input())
    arr = filter(lambda x: x<=2048,map(int,input().split()))
    print('YES' if sum(arr)>=2048 else 'NO')
    t-=1


n = int(input())
for i in range(n):
    arr = filter(lambda x: x<=2048,map(int,input().split()))
print('YES' if sum(arr)>=2048 else 'NO')


import sys
input = sys.stdin.readline
t = int(input())
for _ in range(t):
  n = int(input())
  a = list(map(int,input().split()))
  dp = 1
  for i in range(n):
    dp |= dp<<a[i]
  if dp&1<<2048:
    print("YES")
  else:
    print("NO")


import sys
input = sys.stdin.readline
t = int(input())
for _ in range(t):
  n = int(input())
  a = list(map(int,input().split()))
  dp = 1
  for i in range(n):
    if a[i] > 2048:
      continue
    dp |= dp<<a[i]
  if dp&1<<2048:
    print("YES")
  else:
    print("NO")


for t in range(int(input())):
    n = int(input())
    a = list(map(int,input().split()))
    k1,k2 = 0,0
    for i in range(11):
        i = 2**i
        k1,k2 = k1//2+a.count(i),(k1+a.count(i))//2
        #print(i,k1,k2)
    if k2 > 0 or 2048 in a:
        print('YES')
    else:
        print('NO')


for t in range(int(input())):
    n = int(input())
    a = list(map(int,input().split()))
    k1,k2= a.count(1)//2,0
    for i in range(2,11):
        i = 2**i
        k1,k2 = a.count(i)//2,(k1+a.count(i))//2
        #print(i,k1,k2)
    if k2 > 0 or 2048 in a:
        print('YES')
    else:
        print('NO')


for t in range(int(input())):
    n = int(input())
    a = list(map(int,input().split()))
    k1,k2 = 0,0
    for i in range(11):
        i = 2**i
        k1,k2 = a.count(i)//2,(k2+a.count(i))//2
        #print(i,k1,k2)
    if k2 > 0 or 2048 in a:
        print('YES')
    else:
        print('NO')


for t in range(int(input())):
    n = int(input())
    a = list(map(int,input().split()))
    k1,k2 = 0,0
    for i in range(11):
        i = 2**i
        k1,k2 = k1+a.count(i)//2,(k1+a.count(i))//2
        print(i,k1,k2)
    if k2 > 0 or 2048 in a:
        print('YES')
    else:
        print('NO')


for t in range(int(input())):
    n = int(input())
    a = list(map(int,input().split()))
    k1,k2 = 0,0
    for i in range(11):
        i = 2**i
        k1,k2 = k1+a.count(i)//2,(k1+a.count(i))//2
        #print(i,k1,k2)
    if k2 > 0 or 2048 in a:
        print('YES')
    else:
        print('NO')


for t in range(int(input())):
    n = int(input())
    a = list(map(int,input().split()))
    k1,k2 = 0,0
    for i in range(11):
        i = 2**i
        k1,k2 = k2+a.count(i)//2,(k1+a.count(i))//2
        #print(i,k1,k2)
    if k2 > 0 or 2048 in a:
        print('YES')
    else:
        print('NO')


import kotlin.contracts.contract
import kotlin.math.max
import kotlin.math.min
import kotlin.math.sqrt

private fun readLn() = readLine()!! // string line
private fun readInt() = readLn().toInt() // single int
private fun readStrings() = readLn().split(" ") // list of strings
private fun readInts() = readStrings().map { it.toInt() } // list of ints
private fun readLongs() = readStrings().map { it.toLong() } // list of Longs

fun test(a: List<Int>): String{
    val sum = a.filter { it <= 2048 }.sum()
    return if (sum >= 2048) "YES" else "NO"
}

fun main(){

    val t = readInt()

    for (z in 0 until t){
        val n =readInt()
        val a = readInts()
        println(test(a))
    }

}


fun main() {
    val q = readLine()!!.toInt()

    repeat(q) {
        val n = readLine()!!.toInt()
        val s = readLine()!!
            .split(" ")
            .map { it.toInt() }
            .filter { it <= 2048 }
            .sortedDescending()

        var sum = 2048
        var ans = "NO"

        s.forEach s@{
            if (sum >= it) {
                sum -= it
                if (sum == 0) {
                    ans = "YES"
                    return@s
                }
            } else {
                return@s
            }
        }
        println(ans)
    }
}


import kotlin.math.log2

fun main() {
    val r = System.`in`.bufferedReader()
    val s1 = StringBuilder()
    //val n = r.readLine()!!.split(" ").map { it.toInt() }
    // val n = r.readLine()!!.toInt()
    repeat(r.readLine()!!.toInt()) {
        val l = r.readLine()!!.toInt()
        val v = r.readLine()!!.split(" ").map { log2(it.toDouble()).toInt() }
            .filter { it <= 11 }.sorted().toMutableList()
        var has = false
        while (v.size > 1) {
            if (v[0]==v[1]){
                if (v[0]==10||v[0]==11) has = true
                v += v[0]+1
                v.removeAt(0)
                v.removeAt(0)
                v.sort()
            } else{
                v.removeAt(0)
            }
        }
        if (v[0]==11) has = true
        println(if (has) "YES" else "NO")
    }
}


import kotlin.math.log2

fun main() {
    val r = System.`in`.bufferedReader()
    val s1 = StringBuilder()
    //val n = r.readLine()!!.split(" ").map { it.toInt() }
    // val n = r.readLine()!!.toInt()
    repeat(r.readLine()!!.toInt()) {
        val l = r.readLine()!!.toInt()
        val v0 = IntArray(11) { 0 }
        val v = r.readLine()!!.split(" ").map { it.toInt() }.filter { it <= 2048 }
            .map { log2(it.toDouble()).toInt() }
            .groupBy { it }.map { (k, v) -> Pair(k, v.size) }
        v.forEach { (a, b) ->
            v0[a - 1] += b
        }
        repeat(10) {
            v0[it + 1] += v0[it]/2
        }
        val has = v0[10]>0
        println(if (has) "YES" else "NO")
    }
}


import kotlin.math.log2

fun main() {
    val r = System.`in`.bufferedReader()
    val s1 = StringBuilder()
    //val n = r.readLine()!!.split(" ").map { it.toInt() }
    // val n = r.readLine()!!.toInt()
    repeat(r.readLine()!!.toInt()) {
        val l = r.readLine()!!.toInt()
        val v0 = IntArray(12) { 0 }
        val v = r.readLine()!!.split(" ").map { it.toInt() }.filter { it <= 2048 }
            .map { log2(it.toDouble()).toInt() }
            .groupBy { it }.map { (k, v) -> Pair(k, v.size) }
        v.forEach { (a, b) ->
            v0[a - 1] += b
        }
        repeat(11) {
            v0[it + 1] += v0[it]/2
        }
        val has = v0[11]>0
        println(if (has) "YES" else "NO")
    }
}


import kotlin.math.log2

fun main() {
    val r = System.`in`.bufferedReader()
    val s1 = StringBuilder()
    //val n = r.readLine()!!.split(" ").map { it.toInt() }
    // val n = r.readLine()!!.toInt()
    repeat(r.readLine()!!.toInt()) {
        val l = r.readLine()!!.toInt()
        val v0 = IntArray(12) { 0 }
        val v = r.readLine()!!.split(" ").map { it.toInt() }.filter { it <= 2048 }
            .map { log2(it.toDouble()).toInt() }
            .groupBy { it }.map { (k, v) -> Pair(k, v.size) }
        v.forEach { (a, b) ->
            v0[a] += b
        }
        //v0.forEach { print("$it ") }
        repeat(11) {
            v0[it + 1] += v0[it]/2
        }
        val has = v0[11]>0
        println(if (has) "YES" else "NO")
    }
}


fun main(args: Array<String>) {
    val q = readLine()!!.toInt()
    for (test in 0 until q) {
        val n = readLine()!!.toInt()
        val list = readLine()!!.split(' ').map(String::toInt).toMutableList()
        println(checkCanObtain20148(list))
    }
}

fun checkCanObtain20148(list: MutableList<Int>): String {
    if (list.isEmpty()) return "NO"
    if (list.size == 1) return if (list.first() == 2048) return "YES" else "NO"
    if (list.first() == 2048) return "YES"
    if (list.toSet().toList() == list && list.indexOf(2048) == -1) return "NO"

    val first = list.first()
    val sublist = list.subList(1, list.size)
    if (sublist.size == 1) {
        return if (first == sublist.first() && first == 1024) {
            "YES"
        } else {
            "NO"
        }
    } else {
        val others = sublist.indexOf(first)
        if (others == -1) {
            sublist.add(first)
            return checkCanObtain20148(sublist)
        } else {
            return if (first == 1024) {
                "YES"
            } else {
                list.removeAt(0)
                list.removeAt(others)
                list.add(first + first)
                checkCanObtain20148(list)
            }
        }
    }
}


fun main(args: Array<String>) {
    val q = readLine()!!.toInt()
    for (test in 0 until q) {
        val n = readLine()!!.toInt()
        val list = readLine()!!.split(' ').map(String::toInt).toMutableList()
        println(checkCanObtain20148(list))
    }
}

fun checkCanObtain20148(list: MutableList<Int>): String {
    if (list.isEmpty()) return "NO"
    if (list.size == 1) return if (list[0] == 2048) return "YES" else "NO"
    if (list[0] == 2048) {
        return "YES"
    } else {
        if (list.toSet().toList() == list && list.indexOf(2048) == -1) {
            return "NO"
        } else {
            val first = list.first()
            val sublist = list.subList(1, list.size)
            if (sublist.size == 1) {
                return if (first == sublist.first() && first == 1024 || first == 2048) {
                    "YES"
                } else {
                    "NO"
                }
            } else {
                val others = sublist.indexOf(first)
                if (others == -1) {
                    sublist.add(first)
                    return checkCanObtain20148(sublist)
                } else {
                    return if (first == 1024) {
                        "YES"
                    } else {
                        list.removeAt(0)
                        list.removeAt(others)
                        list.add(first + first)
                        checkCanObtain20148(list)
                    }
                }
            }
        }
    }
}


fun main(args: Array<String>) {
    val q = readLine()!!.toInt()
    for (test in 0 until q) {
        val n = readLine()!!.toInt()
        val list = readLine()!!.split(' ').map(String::toInt).toMutableList()
        println(checkCanObtain20148(list))
    }
}

fun checkCanObtain20148(list: MutableList<Int>): String {
    if (list.isEmpty()) return "NO"
    if (list.size == 1) return if (list.first() == 2048) return "YES" else "NO"
    if (list.first() == 2048) return "YES"
    if (list.toSet().toList() == list && list.indexOf(2048) == -1) return "NO"

    val first = list.first()
    val sublist = list.subList(1, list.size)
    if (sublist.size == 1) {
        return if (first == sublist.first() && first == 1024) {
            "YES"
        } else {
            "NO"
        }
    } else {
        val others = sublist.indexOf(first)
        if (others == -1) {
            sublist.add(first)
            return checkCanObtain20148(sublist)
        } else {
            return if (first + first == 2048) {
                "YES"
            } else {
                list.remove(0)
                list.removeAt(others)
                list.add(first + first)
                checkCanObtain20148(list)
            }
        }
    }
}


fun main(args: Array<String>) {
    val q = readLine()!!.toInt()
    for (test in 0 until q) {
        val n = readLine()!!.toInt()
        val list = readLine()!!.split(' ').map(String::toInt).toMutableList()
        println(checkCanObtain20148(list))
    }
}

fun checkCanObtain20148(list: MutableList<Int>): String {
    if (list.isEmpty()) return "NO"
    if (list.size == 1) return if (list[0] == 2048) return "YES" else "NO"
    if (list[0] == 2048) {
        return "YES"
    } else {
        if (list.toSet().toList() == list && list.indexOf(2048) == -1) {
            return "NO"
        } else {
            val first = list.first()
            val sublist = list.subList(1, list.size)
            if (sublist.isEmpty()) return if (first == 2048) "YES" else "NO"
            if (sublist.size == 1) {
                return if (first == sublist.first() && first == 1024 || first == 2048 || sublist.first() == 2048) {
                    "YES"
                } else {
                    "NO"
                }
            } else {
                val others = sublist.indexOf(first)
                if (others == -1) {
                    sublist.add(first)
                    return checkCanObtain20148(sublist)
                } else {
                    return if (first == 1024) {
                        "YES"
                    } else {
                        list.removeAt(0)
                        list.removeAt(others)
                        list.add(first + first)
                        checkCanObtain20148(list)
                    }
                }
            }
        }
    }
}


fun readIntList() = readLine()!!.split(' ').map(String::toInt).toMutableList()
fun readInt() = readLine()!!.toInt()

var s = mutableListOf<Int>()

fun main(args: Array<String>) {

    val q = readInt()

    (1..q).forEach {
        val n = readInt()
        s = readIntList()

        val bool = rek(2048 , 1)

        println(if(bool) "YES" else "NO")
    }
}

fun rek(elem: Int , target : Int) : Boolean{
    val count = s.count { it == elem }
    if(count >= target)
        return true

    if(elem == 1)return false

    return rek(elem / 2 , (target - count) * 2)
}


import java.util.*

fun main(args: Array<String>) {
    val scanner = Scanner(System.`in`)
    val total = scanner.nextInt()
    repeat((1..total).count()) {
        val elementCount = scanner.nextInt()
        val sequence = (1..elementCount).map { scanner.nextInt() }
        println( if (calculate2048(sequence)) "YES" else "NO" )
    }
}

fun calculate2048(sequence: List<Int>): Boolean {
    val sorted = sequence.sorted().takeWhile { it <= 2048 }
    if (sorted.isEmpty()) return false
    if (sorted.last() == 2048) return true
    if (sorted.distinct() == sorted) return false
    var currentIndex = 0
    val joined = mutableListOf<Int>()
    while (currentIndex < sorted.size) {
        if (currentIndex < sorted.size - 1 && sorted[currentIndex] == sorted[currentIndex+1]) {
            joined.add(sorted[currentIndex]*2)
            currentIndex+=2
        } else {
            joined.add(sorted[currentIndex])
            currentIndex++
        }
    }
    return calculate2048(joined)
}


fun main() {
    val q = readLine()!!.toInt()

    for (i in 1..q) {
        readLine()
        val s = readLine()!!.split(" ").map { it.toInt() }.toMutableList()

        s.sortDescending()
        val mazeSet = mutableSetOf<Int>()

        var res = "NO"
        for (si in s) {
            var curSi = si
            while (curSi<2048 && mazeSet.contains(curSi)) {
                mazeSet.remove(curSi)
                curSi = curSi*2
            }

            if (curSi == 2048) {
                res = "YES"
                break
            }

            mazeSet.add(curSi)
        }

        println(res)
    }
}