#include<bits/stdc++.h>
using namespace std ;
# define pb push_back
# define ll long long
# define mp make_pair
# define endl "\n"

void solve() {
	ll l,r,m ;
	cin >> l>> r >> m ;
	if(m >= l && m <= r ) {
		cout << m << " " << m << " " << m << endl ;
		return ;
	}
	ll dif = r - l  ;
	for(ll i = l ; i <= r ;++i ){
		ll fac = m / i ;
		ll rem = m % i ;

		if(fac >= 1 && l+rem <= r) {
			cout << i << " " << l + rem << " " << l << endl ;
			return ;
		}
		else if(fac==0 || l + l-rem <= r ){
			rem = abs(l - rem) ;
			cout << i << " " << l << " " << l + rem +1  << endl ;
			return ;
		}
	}

}

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

   	int t ;
   	cin >> t;
   	while(t--)
   		solve() ;
   	return 0;
}


#include<bits/stdc++.h>
using namespace std ;
# define pb push_back
# define ll long long
# define mp make_pair
# define endl "\n"

void solve() {
	ll l,r,m ;
	cin >> l>> r >> m ;
	if(m >= l && m <= r ) {
		cout << m << " " << m << " " << m << endl ;
		return ;
	}
	ll dif = r - l  ;
	ll fac = m / l ;
	ll rem = m % l ;
	cout << l << " " ;
	if(fac >= 1 && l+rem <= r) {
		cout << l + rem << " " << l << endl ;
	}
	else {
		rem = abs(l - rem) ;
		cout << l << " " << l + rem  << endl ;
	}

}

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

   	int t ;
   	cin >> t;
   	while(t--)
   		solve() ;
   	return 0;
}


#include<bits/stdc++.h>
using namespace std ;
# define pb push_back
# define ll long long
# define mp make_pair
# define endl "\n"

void solve() {
	ll l,r,m ;
	cin >> l >> r >> m ;
	ll dif = r- l ;
	ll req = m%l ;
	//cout << req << endl;
	if(req <= dif && m >= l ) {
		cout << l << " "  << l + req << " " << l << endl ;
	} else {
		req = l - req ;
		cout << l << " " << l << " " << l + req << endl  ;
	}

}

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

   	int t ;
   	cin >> t;
   	while(t--)
   		solve() ;
   	return 0;
}


#include<bits/stdc++.h>
using namespace std ;
# define pb push_back
# define ll long long
# define mp make_pair
# define endl "\n"

void solve() {
	ll l,r,m ;
	cin >> l>> r >> m ;
	if(m >= l && m <= r ) {
		cout << m << " " << m << " " << m << endl ;
		return ;
	}
	ll dif = r - l  ;
	for(ll i = l ; i <= r ;++i ){
		ll fac = m / i ;
		ll rem = m % i ;

		if(fac >= 1 && l+rem <= r) {
			cout << l << " " << l + rem << " " << l << endl ;
			return ;
		}
		else if(fac==0&& l + l-rem <= r ){
			rem = abs(l - rem) ;
			cout << l << " " << l << " " << l + rem  << endl ;
			return ;
		}
	}

}

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

   	int t ;
   	cin >> t;
   	while(t--)
   		solve() ;
   	return 0;
}


#include<bits/stdc++.h>
using namespace std ;
# define pb push_back
# define ll long long
# define mp make_pair
# define endl "\n"

void solve() {
	ll l1,r,m ;
	cin >> l1 >> r >> m ;

	for(ll l = l1 ; l<=r ; ++l)  {
		ll dif = r- l ;
		ll req = m%l ;
		ll fac = m/l ;
	//cout << req << endl;
		if(req <= dif && fac >= 1 ) {
			cout << l << " "  << l + req << " " << l << endl ;
			return ;
		} else if(fac >= 0  ){
			req = l - req ;
			if(req <= dif)
			cout << l << " " << l << " " << l + req << endl  ;
			return ;
		}
	}

}

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

   	int t ;
   	cin >> t;
   	while(t--)
   		solve() ;
   	return 0;
}


#include<bits/stdc++.h>
using namespace std ;
# define pb push_back
# define ll long long
# define mp make_pair
# define endl "\n"

void solve() {
	ll l1,r,m ;
	cin >> l1 >> r >> m ;

	for(int l = l1 ; l<=r ; ++l)  {
		ll dif = r- l ;
		ll req = m%l ;
	//cout << req << endl;
		if(req <= dif && m >= l ) {
			cout << l << " "  << l + req << " " << l << endl ;
			return ;
		} else {
			req = l - req ;
			if(req <= dif)
			cout << l << " " << l << " " << l + req << endl  ;
			return ;
		}
	}

}

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

   	int t ;
   	cin >> t;
   	while(t--)
   		solve() ;
   	return 0;
}


#include<bits/stdc++.h>
using namespace std ;
# define pb push_back
# define ll long long
# define mp make_pair
# define endl "\n"

void solve() {
	ll l,r,m ;
	cin >> l>> r >> m ;
	for(ll i = l ; i <= r ; ++i) {
		int fac = m / i ;
		int rem1 = m%i ;
		int rem2 = i - m%i ;
		if(fac >=1 && rem1 <= r-l) {
			cout << i << " " << i  +rem1 << " " << i  << endl ;
			return ;
		} else if(rem2 <= r - l ){
			cout << i << " " << i << " " << i + rem2 << endl ;
			return ;
		}
	}

}

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

   	int t ;
   	cin >> t;
   	while(t--)
   		solve() ;
   	return 0;
}


#include<bits/stdc++.h>
using namespace std ;
# define pb push_back
# define ll long long
# define mp make_pair
# define endl "\n"

void solve() {
	ll l,r,m ;
	cin >> l>> r >> m ;
	for(ll i = l ; i <= r ; ++i) {
		int fac = m / i ;
		int rem1 = m%i ;
		int rem2 = i - m%i ;
		if(fac >=1 rem1 <= r-l) {
			cout << i << " " << i  +rem1 << " " << i  << endl ;
			return ;
		} else if(rem2 <= r - l ){
			cout << i << " " << i << " " << i + rem2 << endl ;
			return ;
		}
	}

}

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

   	int t ;
   	cin >> t;
   	while(t--)
   		solve() ;
   	return 0;
}


#include<bits/stdc++.h>
using namespace std ;
# define pb push_back
# define ll long long
# define mp make_pair
# define endl "\n"

void solve() {
	ll l,r,m ;
	cin >> l >> r >> m ;
	ll dif = r- l ;

	ll req = m%l ;
	if(req <= dif) {
		cout << l << " "  << l + req << " " << l << endl ;
	} else {
		req = l - req ;
		cout << l << " " << l << " " << l + req << endl  ;
	}

}

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

   	int t ;
   	cin >> t;
   	while(t--)
   		solve() ;
   	return 0;
}


#include<bits/stdc++.h>
using namespace std ;
# define pb push_back
# define ll long long
# define mp make_pair
# define endl "\n"

void solve() {
	ll l,r,m ;
	cin >> l>> r >> m ;
	if(m >= l && m <= r ) {
		cout << m << " " << m << " " << m << endl ;
		return ;
	}
	ll dif = r - l  ;
	for(ll i = l ; i <= r ;++i ){
		ll fac = m / i ;
		ll rem = m % i ;

		if(fac >= 1 && l+rem <= r) {
			cout << i << " " << l + rem << " " << l << endl ;
			return ;
		}
		else if(fac==0 || l + l-rem <= r ){
			rem = abs(l - rem) ;
			cout << i << " " << l << " " << l + rem  << endl ;
			return ;
		}
	}

}

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

   	int t ;
   	cin >> t;
   	while(t--)
   		solve() ;
   	return 0;
}


#include<bits/stdc++.h>
using namespace std ;
# define pb push_back
# define ll long long
# define mp make_pair
# define endl "\n"

void solve() {
	ll l,r,m ;
	cin >> l>> r >> m ;
	for(ll i = l ; i <= r ; ++i) {
		int fac = m / i ;
		int rem1 = m%i ;
		int rem2 = i - rem1 ;
		//cout << rem1 << " " << rem2 << endl ;
		if(fac >=1 && l + rem1 <= r) {
			cout << i << " " << l  +rem1 << " " << l  << endl ;
			return ;
		} else if(l + rem2 <= r ){
			cout << i << " " << l << " " << l + rem2 << endl ;
			return ;
		}
	}

}

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

   	int t ;
   	cin >> t;
   	while(t--)
   		solve() ;
   	return 0;
}


#include<bits/stdc++.h>
using namespace std ;
# define pb push_back
# define ll long long
# define mp make_pair
# define endl "\n"

void solve() {
	ll l,r,m ;
	cin >> l>> r >> m ;
	if(m >= l && m <= r ) {
		cout << m << " " << m << " " << m << endl ;
		return ;
	}
	ll dif = r - l  ;
	for(ll i = l ; i <= r ;++i ){
		ll fac = m / i ;
		ll rem = m % i ;

		if(fac >= 1 && l+rem <= r) {
			cout << l << " " << l + rem << " " << l << endl ;
			return ;
		}
		else if(fac==0&& l + l-rem <= r ){
			rem = abs(l - rem) ;
			cout << l << " " << l << " " << l + rem  << endl ;
		}
	}

}

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

   	int t ;
   	cin >> t;
   	while(t--)
   		solve() ;
   	return 0;
}


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

void solve() {
    ll l,r,m;
    cin>>l>>r>>m;
    for(ll i = l;i<=r;i++) {
        ll req = i - (m%i);
        if(req == i) req = 0;
        // printf("%lld %lld\n",req,r-l);
        if(req <= (r-l)) {
            ll n = m +req;
            assert(n%i==0 && (n/i>0) && (r-req)>=l);
            cout<<i<<" "<<(r-req)<<" "<<r<<"\n";
            return ;
        }
    }
    for(ll i = l;i<=r;i++) {
        ll req = -(m%i);
        if(-req <= (r-l)) {
            ll n = m+req;
            if(n%i == 0 && n/i>0) {
                cout<<i<<" "<<r<<" "<<r+req<<"\n";
                return ;
            }
        }
    }
}

int main() {
    int t;
    cin>>t;
    while(t--) {
        solve();
    }
    // for(int i = 1;i<300;i++) {
    //     for(int j = i;j<300;j++) {
    //         for(int m = 1;m<300;m++) {
    //             solve(i,j,m);
    //         }
    //     }
    // }
}


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

void solve() {
    ll l,r,m;
    cin>>l>>r>>m;
    for(ll i = l;i<=r;i++) {
        int req = i - (m%i);
        if(req>= l && req<= r) {
            cout<<i<<" "<<i<<" "<<req<<"\n";
            break;
        }
    }
}

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


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

void solve() {
    ll l,r,m;
    cin>>l>>r>>m;
    for(ll i = l;i<=r;i++) {
        int req = i - (m%i);
        if(req<r) {
            int k = (r -req)/i;
            req = req + k*i;
        }
        if((req>= l && req<= r)) {
            ll kk = (m+req - i)/i;
            if(kk <= 0) continue;
            cout<<i<<" "<<i<<" "<<req<<"\n";
            break;
        }
    }
}

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


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

void solve() {
    ll l,r,m;
    cin>>l>>r>>m;
    for(ll i = l;i<=r;i++) {
        if(i == 1) {
            cout<<1<<" "<<1<<" "<<1<<"\n";
            return ;
        }
        ll req = i - (m%i);
        if(req == i) req = 0;
        if(req <= r-l) {
            cout<<i<<" "<<r-req<<" "<<r<<'\n';
            return ;
        }

    }
}

int main() {
    int t;
    cin>>t;
    while(t--) {
        solve();
    }
    // for(int i = 1;i<300;i++) {
    //     for(int j = i;j<300;j++) {
    //         for(int m = 1;m<300;m++) {
    //             solve(i,j,m);
    //         }
    //     }
    // }
}


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

void solve() {
    ll l,r,m;
    cin>>l>>r>>m;
    for(ll i = l;i<=r;i++) {
        // if(i == 1) {
        //     cout<<1<<" "<<1<<" "<<1<<"\n";
        //     return ;
        // }
        ll req = i - (m%i);
        if(req == i) req = 0;
        if(req <= r-l) {
            cout<<i<<" "<<r-req<<" "<<r<<'\n';
            return ;
        }

    }
}

int main() {
    int t;
    cin>>t;
    while(t--) {
        solve();
    }
    // for(int i = 1;i<300;i++) {
    //     for(int j = i;j<300;j++) {
    //         for(int m = 1;m<300;m++) {
    //             solve(i,j,m);
    //         }
    //     }
    // }
}


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

void solve() {
    ll l,r,m;
    cin>>l>>r>>m;
    for(ll i = l;i<=r;i++) {
        ll req = i - (m%i);
        if(req <= r-l) {
            // // ll kk = (m+req - i)/i;
            // // if(kk <= 0) continue;
            // cout<<i<<" "<<i<<" "<<req<<"\n";
            // break;

            cout<<i<<" "<<r-req<<" "<<r<<'\n';
            break ;
        }

    }
}

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


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

void solve() {
    ll l,r,m;
    cin>>l>>r>>m;
    for(ll i = l;i<=r;i++) {
        if(i == 1) {
            cout<<1<<" "<<1<<" "<<1<<"\n";
            return ;
        }
        ll req = i - (m%i);
        if(req <= r-l) {
            // // ll kk = (m+req - i)/i;
            // // if(kk <= 0) continue;
            // cout<<i<<" "<<i<<" "<<req<<"\n";
            // break;

            cout<<i<<" "<<r-req<<" "<<r<<'\n';
            return ;
        }

    }
}

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


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

void solve() {
    ll l,r,m;
    cin>>l>>r>>m;
    for(ll i = l;i<=r;i++) {
        ll req = i - (m%i);
        if(req == i) req = 0;
        if(req <= (r-l)) {
            ll n = m +req;
            assert(n%i==0 && (n/i>0) && (r-req)>=l);
            cout<<i<<" "<<(r-req)<<" "<<r<<"\n";
            return ;
        }
    }
}

int main() {
    int t;
    cin>>t;
    while(t--) {
        solve();
    }
    // for(int i = 1;i<300;i++) {
    //     for(int j = i;j<300;j++) {
    //         for(int m = 1;m<300;m++) {
    //             solve(i,j,m);
    //         }
    //     }
    // }
}


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

void solve() {
    ll l,r,m;
    cin>>l>>r>>m;
    for(ll i = l;i<=r;i++) {
        // if(i == 1) {
        //     cout<<1<<" "<<1<<" "<<1<<"\n";
        //     return ;
        // }
        ll req = i - (m%i);
        if(req == i) req = 0;
        if(req <= r-l) {
            ll n = m +req;
            assert(n%i==0 && n/i>0);
            cout<<i<<" "<<r-req<<" "<<r<<"\n";
            return ;
        }

    }
}

int main() {
    int t;
    cin>>t;
    while(t--) {
        solve();
    }
    // for(int i = 1;i<300;i++) {
    //     for(int j = i;j<300;j++) {
    //         for(int m = 1;m<300;m++) {
    //             solve(i,j,m);
    //         }
    //     }
    // }
}


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

void solve() {
    ll l,r,m;
    cin>>l>>r>>m;
    for(ll i = l;i<=r;i++) {
        ll req = i - (m%i);
        if(req <= r-l) {
            // // ll kk = (m+req - i)/i;
            // // if(kk <= 0) continue;
            // cout<<i<<" "<<i<<" "<<req<<"\n";
            // break;

            cout<<i<<" "<<r-req<<" "<<r<<'\n';
        }

    }
}

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


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

void solve() {
    ll l,r,m;
    cin>>l>>r>>m;
    for(ll i = l;i<=r;i++) {
        // if(i == 1) {
        //     cout<<1<<" "<<1<<" "<<1<<"\n";
        //     return ;
        // }
        ll req = i - (m%i);
        if(req == i) req = 0;
        if(req <= r-l) {
            cout<<i<<" "<<r-req<<" "<<r<<'\n';
            ll n = m +req;
            assert(n%i==0 && n/i>0);
            return ;
        }

    }
}

int main() {
    int t;
    cin>>t;
    while(t--) {
        solve();
    }
    // for(int i = 1;i<300;i++) {
    //     for(int j = i;j<300;j++) {
    //         for(int m = 1;m<300;m++) {
    //             solve(i,j,m);
    //         }
    //     }
    // }
}


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

void solve() {
    ll l,r,m;
    cin>>l>>r>>m;
    for(ll i = l;i<=r;i++) {
        int req = i - (m%i);
        if(req<r) {
            ll k = (r -req)/i;
            req = req + k*i;
        }
        if((req>= l && req<= r)) {
            // ll kk = (m+req - i)/i;
            // if(kk <= 0) continue;
            cout<<i<<" "<<i<<" "<<req<<"\n";
            break;
        }
    }
}

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


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

void solve() {
    ll l,r,m;
    cin>>l>>r>>m;
    for(ll i = l;i<=r;i++) {
        int req = i - (m%i);
        if(req<l) {
            int k = (r -req)/i;
            req = req + k*i;
        }
        if((req>= l && req<= r)) {
            cout<<i<<" "<<i<<" "<<req<<"\n";
            break;
        }
    }
}

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


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

#define inf 1001000009
#define infmx 1e18ll
#define ff first
#define ss second
#define ll long long
#define pb push_back
#define IOS ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL)
#define all(x) x.begin(),x.end()
///debug
#define wh(x)   cerr<<#x<<" is "<<x<<endl;
#define error(args...){string _s=#args;replace(_s.begin(),_s.end(),',',' ');stringstream _ss(_s);istream_iterator<string> _it(_ss);err(_it,args);}
void err(istream_iterator<string>it){cout<<endl;}
template<class H,class... T>void err(istream_iterator<string>it,H a,T... t){cerr<<*it<<" = "<<a<<" | ";err(++it,t...);}
template<class S,class T>ostream&operator<<(ostream&os,pair<S,T>p){os<<"["<<p.first<<", "<<p.second<<"]";return os;};
template<class T>auto&operator<<(ostream& os,vector<T>_v){bool a=1;for(auto x:_v){os<<(a?"":" ")<<x;a=0;}return os;}
///
typedef pair<ll,ll>pi;
typedef pair<long long,long long>pll;
typedef pair<pi,ll>ppi;
typedef pair<ll,pi>pip;
typedef vector<ll>vi;
typedef vector<pi>vpi;
const ll mod=1e9+7;
ll power(ll a,ll p){ll r=1,y=a;while(p){if(p&1)r=(1LL*r*y)%mod;p>>=1;y=(1LL*y*y)%mod;}return r;}

const ll N=2100000;
ll ara[N];
ll l,r,m;
ll check(ll val)
{
    ll sq=sqrt(val);
    for(ll i=1;i<=sq;i++)
    {
        if(val%i==0){
            if(i>=l&&i<=r)return i;
            if(val/i>=l&&val/i<=r)return val/i;
        }
    }
    return -1;
}
int main()
{
    IOS;
    ll t;cin>>t;
    while(t--)
    {
        cin>>l>>r>>m;
        ll dif=r-l;
        ll a,b,c;
        for(ll i=-dif;i<=dif;i++)
        {
            ll f=check(i+m);
            if(f!=-1){
                a=f;
                if(dif>0)b=l;
                else b=r;
                c=b+dif;
            }
        }
        cout<<a<<" "<<b<<" "<<c<<endl;
    }
}


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

#define inf 1001000009
#define infmx 1e18ll
#define ff first
#define ss second
#define ll long long
#define pb push_back
#define IOS ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL)
#define all(x) x.begin(),x.end()
///debug
#define wh(x)   cerr<<#x<<" is "<<x<<endl;
#define error(args...){string _s=#args;replace(_s.begin(),_s.end(),',',' ');stringstream _ss(_s);istream_iterator<string> _it(_ss);err(_it,args);}
void err(istream_iterator<string>it){cout<<endl;}
template<class H,class... T>void err(istream_iterator<string>it,H a,T... t){cerr<<*it<<" = "<<a<<" | ";err(++it,t...);}
template<class S,class T>ostream&operator<<(ostream&os,pair<S,T>p){os<<"["<<p.first<<", "<<p.second<<"]";return os;};
template<class T>auto&operator<<(ostream& os,vector<T>_v){bool a=1;for(auto x:_v){os<<(a?"":" ")<<x;a=0;}return os;}
///
typedef pair<ll,ll>pi;
typedef pair<long long,long long>pll;
typedef pair<pi,ll>ppi;
typedef pair<ll,pi>pip;
typedef vector<ll>vi;
typedef vector<pi>vpi;
const ll mod=1e9+7;
ll power(ll a,ll p){ll r=1,y=a;while(p){if(p&1)r=(1LL*r*y)%mod;p>>=1;y=(1LL*y*y)%mod;}return r;}

const ll N=2100000;
ll ara[N];
ll l,r,m;
int main()
{
    IOS;
    ll t;cin>>t;
    while(t--)
    {
        cin>>l>>r>>m;
        int dif=r-l;
        ll a,b,c;
        for(int i=l;i<=r;i++)
        {
            if(m%i<=dif){
                a=i;
                b=r;
                c=r-m%i;
                ll n=(m-b+c)/a;
//                error(a,b,c,n);
                if(n!=0)break;
            }
            int x=(i-m%i);
            if(x<=dif){
                a=i;
                b=l;
                c=l+m%i;
                ll n=(m-b+c)/a;
//                cerr<<" asd ";
//                error(a,b,c,n);
                if(n==0)continue;
                break;
            }
        }
        cout<<a<<" "<<b<<" "<<c<<endl;
    }
}


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

#define inf 1001000009
#define infmx 1e18ll
#define ff first
#define ss second
#define ll long long
#define pb push_back
#define IOS ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL)
#define all(x) x.begin(),x.end()
///debug
#define wh(x)   cerr<<#x<<" is "<<x<<endl;
#define error(args...){string _s=#args;replace(_s.begin(),_s.end(),',',' ');stringstream _ss(_s);istream_iterator<string> _it(_ss);err(_it,args);}
void err(istream_iterator<string>it){cout<<endl;}
template<class H,class... T>void err(istream_iterator<string>it,H a,T... t){cerr<<*it<<" = "<<a<<" | ";err(++it,t...);}
template<class S,class T>ostream&operator<<(ostream&os,pair<S,T>p){os<<"["<<p.first<<", "<<p.second<<"]";return os;};
template<class T>auto&operator<<(ostream& os,vector<T>_v){bool a=1;for(auto x:_v){os<<(a?"":" ")<<x;a=0;}return os;}
///
typedef pair<ll,ll>pi;
typedef pair<long long,long long>pll;
typedef pair<pi,ll>ppi;
typedef pair<ll,pi>pip;
typedef vector<ll>vi;
typedef vector<pi>vpi;
const ll mod=1e9+7;
ll power(ll a,ll p){ll r=1,y=a;while(p){if(p&1)r=(1LL*r*y)%mod;p>>=1;y=(1LL*y*y)%mod;}return r;}

const ll N=2100000;
ll ara[N];
ll l,r,m;
int main()
{
    IOS;
    ll t;cin>>t;
    while(t--)
    {
        cin>>l>>r>>m;
        ll dif=r-l;
        ll a,b,c;
        for(ll i=l;i<=r;i++)
        {
            if(m%i<=dif){
                a=i;
                b=r;
                c=r-m%i;
                ll n=(m-b+c)/a;
//                error(a,b,c,n);
                if(n!=0)break;
            }
            ll x=(i-m%i);
            if(x<=dif){
                a=i;
                b=r-m%i;
                c=r;
                ll n=(m-b+c)/a;
//                cerr<<" asd ";
//                error(a,b,c,n);
                if(n==0)continue;
                break;
            }
        }
        cout<<a<<" "<<b<<" "<<c<<endl;
    }
}


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

#define inf 1001000009
#define infmx 1e18ll
#define ff first
#define ss second
#define ll long long
#define pb push_back
#define IOS ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL)
#define all(x) x.begin(),x.end()
///debug
#define wh(x)   cerr<<#x<<" is "<<x<<endl;
#define error(args...){string _s=#args;replace(_s.begin(),_s.end(),',',' ');stringstream _ss(_s);istream_iterator<string> _it(_ss);err(_it,args);}
void err(istream_iterator<string>it){cout<<endl;}
template<class H,class... T>void err(istream_iterator<string>it,H a,T... t){cerr<<*it<<" = "<<a<<" | ";err(++it,t...);}
template<class S,class T>ostream&operator<<(ostream&os,pair<S,T>p){os<<"["<<p.first<<", "<<p.second<<"]";return os;};
template<class T>auto&operator<<(ostream& os,vector<T>_v){bool a=1;for(auto x:_v){os<<(a?"":" ")<<x;a=0;}return os;}
///
typedef pair<ll,ll>pi;
typedef pair<long long,long long>pll;
typedef pair<pi,ll>ppi;
typedef pair<ll,pi>pip;
typedef vector<ll>vi;
typedef vector<pi>vpi;
const ll mod=1e9+7;
ll power(ll a,ll p){ll r=1,y=a;while(p){if(p&1)r=(1LL*r*y)%mod;p>>=1;y=(1LL*y*y)%mod;}return r;}

const ll N=2100000;
ll ara[N];
ll l,r,m;
int main()
{
    IOS;
    ll t;cin>>t;
    while(t--)
    {
        cin>>l>>r>>m;
        ll dif=r-l;
        ll a,b,c;
        for(ll i=l;i<=r;i++)
        {
            if(m%i<=dif){
                a=i;
                b=r;
                c=r-m%i;
                ll n=(m-b+c)/a;
//                error(a,b,c,n);
                if(n!=0)break;
            }
            ll x=(i-m%i);
            if(x<=dif){
                a=i;
                b=l;
                c=l+m%i;
                ll n=(m-b+c)/a;
//                cerr<<" asd ";
//                error(a,b,c,n);
                if(n==0)continue;
                break;
            }
        }
        cout<<a<<" "<<b<<" "<<c<<endl;
    }
}


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

#define inf 1001000009
#define infmx 1e18ll
#define ff first
#define ss second
#define ll long long
#define pb push_back
#define IOS ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL)
#define all(x) x.begin(),x.end()
///debug
#define wh(x)   cerr<<#x<<" is "<<x<<endl;
#define error(args...){string _s=#args;replace(_s.begin(),_s.end(),',',' ');stringstream _ss(_s);istream_iterator<string> _it(_ss);err(_it,args);}
void err(istream_iterator<string>it){cout<<endl;}
template<class H,class... T>void err(istream_iterator<string>it,H a,T... t){cerr<<*it<<" = "<<a<<" | ";err(++it,t...);}
template<class S,class T>ostream&operator<<(ostream&os,pair<S,T>p){os<<"["<<p.first<<", "<<p.second<<"]";return os;};
template<class T>auto&operator<<(ostream& os,vector<T>_v){bool a=1;for(auto x:_v){os<<(a?"":" ")<<x;a=0;}return os;}
///
typedef pair<ll,ll>pi;
typedef pair<long long,long long>pll;
typedef pair<pi,ll>ppi;
typedef pair<ll,pi>pip;
typedef vector<ll>vi;
typedef vector<pi>vpi;
const ll mod=1e9+7;
ll power(ll a,ll p){ll r=1,y=a;while(p){if(p&1)r=(1LL*r*y)%mod;p>>=1;y=(1LL*y*y)%mod;}return r;}

const ll N=2100000;
ll ara[N];
ll l,r,m;
ll check(ll val)
{
    ll sq=sqrt(val);
    ll mn=min(sq,r);
    for(ll i=1;i<=sq;i++)
    {
        if(val%i==0){
            if(i>=l&&i<=r)return i;
            if(val/i>=l&&val/i<=r)return val/i;
        }
    }
    return -1;
}
int main()
{
    IOS;
    ll t;cin>>t;
    while(t--)
    {
        cin>>l>>r>>m;
        int dif=r-l;
        ll a,b,c;
        for(ll i=max(-dif,-100);i<=min(dif,100);i++)
        {
            ll f=check(i+m);
            if(f!=-1){
                a=f;
                if(dif>0)b=l;
                else b=r;
                c=b+dif;
            }
        }
        cout<<a<<" "<<b<<" "<<c<<endl;
    }
}


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

#define inf 1001000009
#define infmx 1e18ll
#define ff first
#define ss second
#define ll long long
#define pb push_back
#define IOS ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL)
#define all(x) x.begin(),x.end()
///debug
#define wh(x)   cerr<<#x<<" is "<<x<<endl;
#define error(args...){string _s=#args;replace(_s.begin(),_s.end(),',',' ');stringstream _ss(_s);istream_iterator<string> _it(_ss);err(_it,args);}
void err(istream_iterator<string>it){cout<<endl;}
template<class H,class... T>void err(istream_iterator<string>it,H a,T... t){cerr<<*it<<" = "<<a<<" | ";err(++it,t...);}
template<class S,class T>ostream&operator<<(ostream&os,pair<S,T>p){os<<"["<<p.first<<", "<<p.second<<"]";return os;};
template<class T>auto&operator<<(ostream& os,vector<T>_v){bool a=1;for(auto x:_v){os<<(a?"":" ")<<x;a=0;}return os;}
///
typedef pair<ll,ll>pi;
typedef pair<long long,long long>pll;
typedef pair<pi,ll>ppi;
typedef pair<ll,pi>pip;
typedef vector<ll>vi;
typedef vector<pi>vpi;
const ll mod=1e9+7;
ll power(ll a,ll p){ll r=1,y=a;while(p){if(p&1)r=(1LL*r*y)%mod;p>>=1;y=(1LL*y*y)%mod;}return r;}

const ll N=2100000;
ll ara[N];
ll l,r,m;
ll check(ll val)
{
    ll sq=sqrt(val);
    ll mn=min(sq,r);
    for(ll i=1;i<=sq;i++)
    {
        if(val%i==0){
            if(i>=l&&i<=r)return i;
            if(val/i>=l&&val/i<=r)return val/i;
        }
    }
    return -1;
}
int main()
{
    IOS;
    ll t;cin>>t;
    while(t--)
    {
        cin>>l>>r>>m;
        int dif=r-l;
        ll a,b,c;
        for(ll i=max(-dif,-1000);i<=min(dif,1000);i++)
        {
            ll f=check(i+m);
            if(f!=-1){
                a=f;
                if(dif>0)b=l;
                else b=r;
                c=b+dif;
            }
        }
        cout<<a<<" "<<b<<" "<<c<<endl;
    }
}


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

#define inf 1001000009
#define infmx 1e18ll
#define ff first
#define ss second
#define ll long long
#define pb push_back
#define IOS ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL)
#define all(x) x.begin(),x.end()
///debug
#define wh(x)   cerr<<#x<<" is "<<x<<endl;
#define error(args...){string _s=#args;replace(_s.begin(),_s.end(),',',' ');stringstream _ss(_s);istream_iterator<string> _it(_ss);err(_it,args);}
void err(istream_iterator<string>it){cout<<endl;}
template<class H,class... T>void err(istream_iterator<string>it,H a,T... t){cerr<<*it<<" = "<<a<<" | ";err(++it,t...);}
template<class S,class T>ostream&operator<<(ostream&os,pair<S,T>p){os<<"["<<p.first<<", "<<p.second<<"]";return os;};
template<class T>auto&operator<<(ostream& os,vector<T>_v){bool a=1;for(auto x:_v){os<<(a?"":" ")<<x;a=0;}return os;}
///
typedef pair<ll,ll>pi;
typedef pair<long long,long long>pll;
typedef pair<pi,ll>ppi;
typedef pair<ll,pi>pip;
typedef vector<ll>vi;
typedef vector<pi>vpi;
const ll mod=1e9+7;
ll power(ll a,ll p){ll r=1,y=a;while(p){if(p&1)r=(1LL*r*y)%mod;p>>=1;y=(1LL*y*y)%mod;}return r;}

const ll N=2100000;
ll ara[N];
ll l,r,m;
int main()
{
    IOS;
    ll t;cin>>t;
    while(t--)
    {
        cin>>l>>r>>m;
        ll dif=r-l;
        ll a,b,c;
        for(ll i=l;i<=r;i++)
        {
            if(m%i<=dif){
                a=i;
                b=r;
                c=r-m%i;
                ll n=(m-b+c)/a;
//                error(a,b,c,n);
                if(n!=0)break;
            }
            ll x=(i-m%i);
            if(x<=dif){
                a=i;
                b=r-x;
                c=r;
                ll n=(m-b+c)/a;
//                cerr<<" asd ";
//                error(a,b,c,n,x);
                if(n!=0&&(b>=l))break;
            }
        }
        cout<<a<<" "<<b<<" "<<c<<endl;
    }
}

/*
11 12 21

*/


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

#define inf 1001000009
#define infmx 1e18ll
#define ff first
#define ss second
#define ll long long
#define pb push_back
#define IOS ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL)
#define all(x) x.begin(),x.end()
///debug
#define wh(x)   cerr<<#x<<" is "<<x<<endl;
#define error(args...){string _s=#args;replace(_s.begin(),_s.end(),',',' ');stringstream _ss(_s);istream_iterator<string> _it(_ss);err(_it,args);}
void err(istream_iterator<string>it){cout<<endl;}
template<class H,class... T>void err(istream_iterator<string>it,H a,T... t){cerr<<*it<<" = "<<a<<" | ";err(++it,t...);}
template<class S,class T>ostream&operator<<(ostream&os,pair<S,T>p){os<<"["<<p.first<<", "<<p.second<<"]";return os;};
template<class T>auto&operator<<(ostream& os,vector<T>_v){bool a=1;for(auto x:_v){os<<(a?"":" ")<<x;a=0;}return os;}
///
typedef pair<ll,ll>pi;
typedef pair<long long,long long>pll;
typedef pair<pi,ll>ppi;
typedef pair<ll,pi>pip;
typedef vector<ll>vi;
typedef vector<pi>vpi;
const ll mod=1e9+7;
ll power(ll a,ll p){ll r=1,y=a;while(p){if(p&1)r=(1LL*r*y)%mod;p>>=1;y=(1LL*y*y)%mod;}return r;}

const ll N=2100000;
ll ara[N];
ll l,r,m;
int main()
{
    IOS;
    ll t;cin>>t;
    while(t--)
    {
        cin>>l>>r>>m;
        int dif=r-l;
        ll a,b,c;
        for(int i=l;i<=r;i++)
        {
            if(m%i<=dif){
                a=i;
                b=l;
                c=l+m%i;
                break;
            }
        }
        cout<<a<<" "<<b<<" "<<c<<endl;
    }
}


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

#define inf 1001000009
#define infmx 1e18ll
#define ff first
#define ss second
#define ll long long
#define pb push_back
#define IOS ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL)
#define all(x) x.begin(),x.end()
///debug
#define wh(x)   cerr<<#x<<" is "<<x<<endl;
#define error(args...){string _s=#args;replace(_s.begin(),_s.end(),',',' ');stringstream _ss(_s);istream_iterator<string> _it(_ss);err(_it,args);}
void err(istream_iterator<string>it){cout<<endl;}
template<class H,class... T>void err(istream_iterator<string>it,H a,T... t){cerr<<*it<<" = "<<a<<" | ";err(++it,t...);}
template<class S,class T>ostream&operator<<(ostream&os,pair<S,T>p){os<<"["<<p.first<<", "<<p.second<<"]";return os;};
template<class T>auto&operator<<(ostream& os,vector<T>_v){bool a=1;for(auto x:_v){os<<(a?"":" ")<<x;a=0;}return os;}
///
typedef pair<ll,ll>pi;
typedef pair<long long,long long>pll;
typedef pair<pi,ll>ppi;
typedef pair<ll,pi>pip;
typedef vector<ll>vi;
typedef vector<pi>vpi;
const ll mod=1e9+7;
ll power(ll a,ll p){ll r=1,y=a;while(p){if(p&1)r=(1LL*r*y)%mod;p>>=1;y=(1LL*y*y)%mod;}return r;}

const ll N=2100000;
ll ara[N];
ll l,r,m;
ll check(ll val)
{
    for(ll i=1;i<=val;i++)
    {
        if(val%i==0){
            if(i>=l&&i<=r)return i;
            if(val/i>=l&&val/i<=r)return val/i;
        }
    }
    return -1;
}
int main()
{
    IOS;
    ll t;cin>>t;
    while(t--)
    {
        cin>>l>>r>>m;
        ll dif=r-l;
        ll a,b,c;
        for(ll i=-dif;i<=dif;i++)
        {
            ll f=check(i+m);
            if(f!=-1){
                a=f;
                if(dif>0)b=l;
                else b=r;
                c=b+dif;
            }
        }
        cout<<a<<" "<<b<<" "<<c<<endl;
    }
}


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

#define inf 1001000009
#define infmx 1e18ll
#define ff first
#define ss second
#define ll long long
#define pb push_back
#define IOS ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL)
#define all(x) x.begin(),x.end()
///debug
#define wh(x)   cerr<<#x<<" is "<<x<<endl;
#define error(args...){string _s=#args;replace(_s.begin(),_s.end(),',',' ');stringstream _ss(_s);istream_iterator<string> _it(_ss);err(_it,args);}
void err(istream_iterator<string>it){cout<<endl;}
template<class H,class... T>void err(istream_iterator<string>it,H a,T... t){cerr<<*it<<" = "<<a<<" | ";err(++it,t...);}
template<class S,class T>ostream&operator<<(ostream&os,pair<S,T>p){os<<"["<<p.first<<", "<<p.second<<"]";return os;};
template<class T>auto&operator<<(ostream& os,vector<T>_v){bool a=1;for(auto x:_v){os<<(a?"":" ")<<x;a=0;}return os;}
///
typedef pair<ll,ll>pi;
typedef pair<long long,long long>pll;
typedef pair<pi,ll>ppi;
typedef pair<ll,pi>pip;
typedef vector<ll>vi;
typedef vector<pi>vpi;
const ll mod=1e9+7;
ll power(ll a,ll p){ll r=1,y=a;while(p){if(p&1)r=(1LL*r*y)%mod;p>>=1;y=(1LL*y*y)%mod;}return r;}

const ll N=2100000;
ll ara[N];
ll l,r,m;
int main()
{
    IOS;
    ll t;cin>>t;
    while(t--)
    {
        cin>>l>>r>>m;
        ll dif=r-l;
        ll a,b,c;
        for(ll i=l;i<=r;i++)
        {
            if(m%i<=dif){
                a=i;
                b=r;
                c=r-m%i;
                ll n=(m-b+c)/a;
//                error(a,b,c,n);
                if(n!=0)break;
            }
            ll x=(i-m%i);
            if(x<=dif){
                a=i;
                b=r-m%i;
                c=r;
                ll n=(m-b+c)/a;
//                cerr<<" asd ";
//                error(a,b,c,n);
                if(n!=0&&(b>=l))break;
            }
        }
        cout<<a<<" "<<b<<" "<<c<<endl;
    }
}


#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef long L;
const char NL = '\n';
#define PI 3.14159265
#define f(i, a, b) for (int i = a; i < b; i++)
#define fr(i, a, b) for (int i = a; i >= b; i--)
#define testf int t;scanf("%d", &t);while (t--)
#define test int t;cin >> t;while (t--)
#define mod 1000000007
#define all(a) a.begin(), a.end()
#define size(container) (int)container.size()
#define int long long int

void solve()
{
    test
    {
        int l,r,m;cin>>l>>r>>m;
        int mv = l-r;
        int mxv = r-l;
        int a,b,c;
        int v;
        f(i,l,r+1)
        {
            a = i;
            v = m%i;
            c = l;
            b = v+l;
            int alv = (m+c-b)/a;
            if((m+c-b)%a != 0 || alv == 0)
            {
                swap(c,b);
            }
            alv = (m+c-b)/a;
            // cout<<a<<" "<<b<<" "<<c<<NL;
            if(a>=l && a <= r && b >= l && b <= r && c>=l && c <= r && (m+c-b)%a == 0 && alv != 0)
            {
                // cout<<"fdsfs"<<NL;
                break;
            }
        }
        // c = l;
        // b = v+l;
        // if((m+c-b)%a != 0 || alv == 0)
        // {
        //     swap(c,b);
        // }
        cout<<a<<" "<<b<<" "<<c<<NL;
    }
}

int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    // clock_t st = clock();
    // all the code goes here
    solve();
    // cout<<"Time taken "<<((float)clock()-st)/CLOCKS_PER_SEC<<endl;
    fflush(stdin);
    fflush(stdout);
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef long L;
const char NL = '\n';
#define PI 3.14159265
#define f(i, a, b) for (int i = a; i < b; i++)
#define fr(i, a, b) for (int i = a; i >= b; i--)
#define testf int t;scanf("%d", &t);while (t--)
#define test int t;cin >> t;while (t--)
#define mod 1000000007
#define all(a) a.begin(), a.end()
#define size(container) (int)container.size()
#define int long long int
#define fh freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);
void solve()
{
    // fh;
    test
    {
        int l,r,m;cin>>l>>r>>m;
        int mv = l-r;
        int mxv = r-l;
        int a = l,b = l,c = l;
        int v = LLONG_MAX;
        f(i,l,r+1)
        {
            int r = m%i;
            if(r >= mv && r <= mxv)
            {
                v = r;
                a = i;
                break;
            }
            int res = i*(m/i+1)-m;
            // cout<<"res "<<res<<NL;
            if(res >= mv && res <= mxv)
            {
                v = res;
                a = i;
                break;
            }
        }
        if(v == LLONG_MAX)
            v = m-l;
        bool en = 0;
        f(i,l,r+1)
        {
            c = i;
            b = v+i;
            int alv = (m+c-b)/a;
            if(a>=l && a <= r && b >= l && b <= r && c>=l && c <= r && (m+c-b)%a == 0 && alv != 0)
            {
                en = 1;
                break;
            }
        }
        if(!en)
        {
            f(i,l,r+1)
            {
                b = i;
                c = v+i;
                int alv = (m+c-b)/a;
                if(a>=l && a <= r && b >= l && b <= r && c>=l && c <= r && (m+c-b)%a == 0 && alv != 0)
                {
                    en = 1;
                    // cout<<"fdsfs"<<NL;
                    break;
                }
            }
        }
        cout<<a<<" "<<b<<" "<<c<<NL;
    }
}

int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    // clock_t st = clock();
    // all the code goes here
    solve();
    // cout<<"Time taken "<<((float)clock()-st)/CLOCKS_PER_SEC<<endl;
    fflush(stdin);
    fflush(stdout);
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef long L;
const char NL = '\n';
#define PI 3.14159265
#define f(i, a, b) for (int i = a; i < b; i++)
#define fr(i, a, b) for (int i = a; i >= b; i--)
#define testf int t;scanf("%d", &t);while (t--)
#define test int t;cin >> t;while (t--)
#define mod 1000000007
#define all(a) a.begin(), a.end()
#define size(container) (int)container.size()
#define int long long int
#define fh freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);
void solve()
{
    // fh;
    test
    {
        int l,r,m;cin>>l>>r>>m;
        int mv = l-r;
        int mxv = r-l;
        int a = l,b = l,c = l;
        int v = LLONG_MAX;
        f(i,l,r+1)
        {
            if(mv <= (m%i) && (m%i) <= mxv)
            {
                v = m%i;
                a = i;
                break;
            }
        }
        if(v == LLONG_MAX)
            v = m-l;
        bool en = 0;
        f(i,l,r+1)
        {
            c = i;
            b = v+i;
            int alv = (m+c-b)/a;
            if(a>=l && a <= r && b >= l && b <= r && c>=l && c <= r && (m+c-b)%a == 0 && alv != 0)
            {
                en = 1;
                break;
            }
        }
        if(!en)
        {
            f(i,l,r+1)
            {
                b = i;
                c = v+i;
                int alv = (m+c-b)/a;
                if(a>=l && a <= r && b >= l && b <= r && c>=l && c <= r && (m+c-b)%a == 0 && alv != 0)
                {
                    en = 1;
                    // cout<<"fdsfs"<<NL;
                    break;
                }
            }
        }
        cout<<a<<" "<<b<<" "<<c<<NL;
    }
}

int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    // clock_t st = clock();
    // all the code goes here
    solve();
    // cout<<"Time taken "<<((float)clock()-st)/CLOCKS_PER_SEC<<endl;
    fflush(stdin);
    fflush(stdout);
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef long L;
const char NL = '\n';
#define PI 3.14159265
#define f(i, a, b) for (int i = a; i < b; i++)
#define fr(i, a, b) for (int i = a; i >= b; i--)
#define testf int t;scanf("%d", &t);while (t--)
#define test int t;cin >> t;while (t--)
#define mod 1000000007
#define all(a) a.begin(), a.end()
#define size(container) (int)container.size()
#define int long long int
#define fh freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);
void solve()
{
    // fh;
    test
    {
        int l,r,m;cin>>l>>r>>m;
        int mv = l-r;
        int mxv = r-l;
        int a = l,b = l,c = l;
        int v;
        f(i,l,r+1)
        {
            if(mv <= (m%i) && (m%i) <= mxv)
            {
                v = m%i;
                a = i;
                break;
            }
        }

        bool en = 0;
        f(i,l,r+1)
        {
            c = i;
            b = v+i;
            int alv = (m+c-b)/a;
            if(a>=l && a <= r && b >= l && b <= r && c>=l && c <= r && (m+c-b)%a == 0 && alv != 0)
            {
                en = 1;
                break;
            }
        }
        if(!en)
        {
            f(i,l,r+1)
            {
                b = i;
                c = v+i;
                int alv = (m+c-b)/a;
                if(a>=l && a <= r && b >= l && b <= r && c>=l && c <= r && (m+c-b)%a == 0 && alv != 0)
                {
                    en = 1;
                    // cout<<"fdsfs"<<NL;
                    break;
                }
            }
        }
        cout<<a<<" "<<b<<" "<<c<<NL;
    }
}

int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    // clock_t st = clock();
    // all the code goes here
    solve();
    // cout<<"Time taken "<<((float)clock()-st)/CLOCKS_PER_SEC<<endl;
    fflush(stdin);
    fflush(stdout);
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef long L;
const char NL = '\n';
#define PI 3.14159265
#define f(i, a, b) for (int i = a; i < b; i++)
#define fr(i, a, b) for (int i = a; i >= b; i--)
#define testf int t;scanf("%d", &t);while (t--)
#define test int t;cin >> t;while (t--)
#define mod 1000000007
#define all(a) a.begin(), a.end()
#define size(container) (int)container.size()
#define int long long int
#define fh freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);
void solve()
{
    fh;
    test
    {
        int l,r,m;cin>>l>>r>>m;
        int mv = l-r;
        int mxv = r-l;
        int a = l,b = l,c = l;
        int v;
        f(i,l,r+1)
        {
            if(mv <= (m%i) && (m%i) <= mxv)
            {
                v = m%i;
                a = i;
                break;
            }
        }

        bool en = 0;
        f(i,l,r+1)
        {
            c = i;
            b = v+i;
            int alv = (m+c-b)/a;
            if(a>=l && a <= r && b >= l && b <= r && c>=l && c <= r && (m+c-b)%a == 0 && alv != 0)
            {
                en = 1;
                break;
            }
        }
        if(!en)
        {
            f(i,l,r+1)
            {
                b = i;
                c = v+i;
                int alv = (m+c-b)/a;
                if(a>=l && a <= r && b >= l && b <= r && c>=l && c <= r && (m+c-b)%a == 0 && alv != 0)
                {
                    en = 1;
                    // cout<<"fdsfs"<<NL;
                    break;
                }
            }
        }
        cout<<a<<" "<<b<<" "<<c<<NL;
    }
}

int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    // clock_t st = clock();
    // all the code goes here
    solve();
    // cout<<"Time taken "<<((float)clock()-st)/CLOCKS_PER_SEC<<endl;
    fflush(stdin);
    fflush(stdout);
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef long L;
const char NL = '\n';
#define PI 3.14159265
#define f(i, a, b) for (int i = a; i < b; i++)
#define fr(i, a, b) for (int i = a; i >= b; i--)
#define testf int t;scanf("%d", &t);while (t--)
#define test int t;cin >> t;while (t--)
#define mod 1000000007
#define all(a) a.begin(), a.end()
#define size(container) (int)container.size()
#define int long long int

void solve()
{
    test
    {
        int l,r,m;cin>>l>>r>>m;
        int mv = l-r;
        int mxv = r-l;
        int a,b,c;
        int v;
        f(i,l,r+1)
        {
            if(mv <= (m%i) && (m%i) <= mxv)
            {
                v = m%i;
                a = i;
                break;
            }
        }

        f(i,l,r+1)
        {
            c = i;
            b = v+i;
            int alv = (m+c-b)/a;
            if((m+c-b)%a != 0 || alv == 0)
            {
                swap(c,b);
            }
            alv = (m+c-b)/a;
            if(a>=l && a <= r && b >= l && b <= r && c>=l && c <= r && (m+c-b)%a == 0 && alv != 0)
            {
                // cout<<"fdsfs"<<NL;
                break;
            }
        }
        cout<<a<<" "<<b<<" "<<c<<NL;
    }
}

int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    // clock_t st = clock();
    // all the code goes here
    solve();
    // cout<<"Time taken "<<((float)clock()-st)/CLOCKS_PER_SEC<<endl;
    fflush(stdin);
    fflush(stdout);
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef long L;
const char NL = '\n';
#define PI 3.14159265
#define f(i, a, b) for (int i = a; i < b; i++)
#define fr(i, a, b) for (int i = a; i >= b; i--)
#define testf int t;scanf("%d", &t);while (t--)
#define test int t;cin >> t;while (t--)
#define mod 1000000007
#define all(a) a.begin(), a.end()
#define size(container) (int)container.size()
#define int long long int
#define fh freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);
void solve()
{
    // fh;

    test
    {
        int l,r,m;cin>>l>>r>>m;
        int mv = l-r;
        int mxv = r-l;
        int a = l,b = l,c = l;
        int v = LLONG_MAX;
        f(i,l,r+1)
        {
            int r = m%i;
            if(r >= mv && r <= mxv)
            {
                v = r;
                a = i;
                break;
            }
            int res = i*(m/i+1)-m;
            // cout<<"res "<<res<<NL;
            if(res >= mv && res <= mxv)
            {
                v = res;
                a = i;
                break;
            }
        }
        if(v == LLONG_MAX)
            v = m-l;
        bool en = 0;
        f(i,l,r+1)
        {
            c = i;
            b = v+i;
            int alv = (m+c-b)/a;
            if(a>=l && a <= r && b >= l && b <= r && c>=l && c <= r && (m+c-b)%a == 0 && alv != 0)
            {
                en = 1;
                break;
            }
        }
        if(!en)
        {
            f(i,l,r+1)
            {
                b = i;
                c = v+i;
                int alv = (m+c-b)/a;
                if(a>=l && a <= r && b >= l && b <= r && c>=l && c <= r && (m+c-b)%a == 0 && alv != 0)
                {
                    // cout<<"fdsfs"<<NL;
                    break;
                }
            }
        }
        cout<<a<<" "<<b<<" "<<c<<NL;
    }
}

int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    // clock_t st = clock();
    // all the code goes here
    solve();
    // cout<<"Time taken "<<((float)clock()-st)/CLOCKS_PER_SEC<<endl;
    fflush(stdin);
    fflush(stdout);
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef long L;
const char NL = '\n';
#define PI 3.14159265
#define f(i, a, b) for (int i = a; i < b; i++)
#define fr(i, a, b) for (int i = a; i >= b; i--)
#define testf int t;scanf("%d", &t);while (t--)
#define test int t;cin >> t;while (t--)
#define mod 1000000007
#define all(a) a.begin(), a.end()
#define size(container) (int)container.size()
#define int long long int

void solve()
{
    test
    {
        int l,r,m;cin>>l>>r>>m;
        int mv = l-r;
        int mxv = r-l;
        int a,b,c;
        int v;
        f(i,l,r+1)
        {
            if(mv <= (m%i) && (m%i) <= mxv)
            {
                v = m%i;
                a = i;
                break;
            }
        }

        bool en = 0;
        f(i,l,r+1)
        {
            c = i;
            b = v+i;
            int alv = (m+c-b)/a;
            if(a>=l && a <= r && b >= l && b <= r && c>=l && c <= r && (m+c-b)%a == 0 && alv != 0)
            {
                en = 1;
                // cout<<"fdsfs"<<NL;
                break;
            }
        }
        if(!en)
        {
            f(i,l,r+1)
            {
                b = i;
                c = v+i;
                int alv = (m+c-b)/a;
                if(a>=l && a <= r && b >= l && b <= r && c>=l && c <= r && (m+c-b)%a == 0 && alv != 0)
                {
                    en = 1;
                    // cout<<"fdsfs"<<NL;
                    break;
                }
            }
        }
        cout<<a<<" "<<b<<" "<<c<<NL;
    }
}

int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    // clock_t st = clock();
    // all the code goes here
    solve();
    // cout<<"Time taken "<<((float)clock()-st)/CLOCKS_PER_SEC<<endl;
    fflush(stdin);
    fflush(stdout);
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef long L;
const char NL = '\n';
#define PI 3.14159265
#define f(i, a, b) for (int i = a; i < b; i++)
#define fr(i, a, b) for (int i = a; i >= b; i--)
#define testf int t;scanf("%d", &t);while (t--)
#define test int t;cin >> t;while (t--)
#define mod 1000000007
#define all(a) a.begin(), a.end()
#define size(container) (int)container.size()
#define int long long int
#define pb push_back
#define fh freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);
clock_t startTime;
double getCurrentTime() {
	return (double)(clock() - startTime) / CLOCKS_PER_SEC;
}
void readarray(vector<int> &a)
{
    for(auto &it : a)cin>>it;
}

void solve()
{
    // fh;// comment this line before submitting to online judge
    // all the code goes here
    test
    {
        int l,r,m;cin>>l>>r>>m;
        int a = l,b,c,val;
        f(i,l,r+1)
        {
            int res = (m+r-l)/i;
            if(res*i<=(m+r-l) && res*i >=  (m-r+l))
            {
                val = res;
                a = i;
                break;
            }
        }
        if(m-val*a < 0)
        {
            b = l,c = abs(m-val*a)+l;
        }
        else
            c = l,b=abs(val*a-m)+l;
        cout<<a<<" "<<b<<" "<<c<<NL;
    }
}

int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    startTime = clock();
    solve();
    fflush(stdin);
    fflush(stdout);
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef long L;
const char NL = '\n';
#define PI 3.14159265
#define f(i, a, b) for (int i = a; i < b; i++)
#define fr(i, a, b) for (int i = a; i >= b; i--)
#define testf int t;scanf("%d", &t);while (t--)
#define test int t;cin >> t;while (t--)
#define mod 1000000007
#define all(a) a.begin(), a.end()
#define size(container) (int)container.size()
#define int long long int

void solve()
{
    test
    {
        int l,r,m;cin>>l>>r>>m;
        int mv = l-r;
        int mxv = r-l;
        int a,b,c;
        int v;
        f(i,l,r+1)
        {
            // cout<<"i "<<i<<NL;
            // cout<<"m "<<m<<NL;
            // cout<<"val "<<m%i<<NL;
            if(mv <= (m%i) && (m%i) <= mxv)
            {
                v = m%i;
                a = i;
                break;
            }
        }
        // cout<<v<<" "<<a<<NL;
        // cout<<"v "<<v<<NL;
        c = l;
        b = v+l;
        int alv = (m+c-b)/a;
        if((m+c-b)%a != 0 || alv == 0)
        {
            swap(c,b);
        }
        cout<<a<<" "<<b<<" "<<c<<NL;
    }
}

int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    // clock_t st = clock();
    // all the code goes here
    solve();
    // cout<<"Time taken "<<((float)clock()-st)/CLOCKS_PER_SEC<<endl;
    fflush(stdin);
    fflush(stdout);
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define run  ios_base::sync_with_stdio(false);cin.tie(NULL);

int main()
 {
  run;
  ll t;
  cin>>t;
  while(t--)
  {
      ll l,r,m,i,ok=0,j,x,y;
      cin>>l>>r>>m;

      y=l-r;
      x=r-l;

      for(i=x;i>=y;i--)
      {
          for(j=1;j<=100;j++)
          {
              if((m+i)%j==0)
                {
                    ll p=(m+i)/j;
                    if(p>=l&&r>=p)
                    {
                        cout<<p<<" "<<l+i<<" "<<l<<endl;
                        ok=1;
                        break;
                    }
                }
          }
           if(ok==1)
                break;

          }

      }

 }


#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define run  ios_base::sync_with_stdio(false);cin.tie(NULL);

int main()
 {
  run;
  ll t;
  cin>>t;
  while(t--)
  {
      ll l,r,m,i,p,ok=0,res,res1;
      cin>>l>>r>>m;

      for(i=l;i<=r;i++)
      {
          p=m%i;
          if(m-p!=0)
          {
             if(i-p<l)
             {
                 res=r;
                 res1=res-p;
             }
             else
             {
                 res=i;
                 res1=res-p;
             }

              cout<<i<<" "<<res<<" "<<res1<<endl;
              break;

          }
          else if((m+i+p)!=0)
          {
              //cout<<2*i-p<<" ";
              if(2*i-p>r)
              {

                  res=l;
                  res1=2*l-p;
              }
               else
             {
                 res=i;
                 res1=2*i-p;
             }

              cout<<i<<" "<<res<<" "<<res1<<endl;
              break;

          }

      }

  }
 }


#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define run  ios_base::sync_with_stdio(false);cin.tie(NULL);

int main()
 {
  run;
  ll t;
  cin>>t;
  while(t--)
  {
      ll l,r,m,i,ok=0,j,x,y,x1,x2,p,y1,res;
      cin>>l>>r>>m;

      y=l-r;
      x=r-l;

      y1=(m+l-r)/r;
      y1--;
      if(y1<=0)
      y1=1;
      x2=(m+r-l)/l;
      x2++;
    //  cout<<y1<< " "<<x2<<" "<<endl;
      for(i=x;i>=y;i--)
      {
          for(j=y1;j<=x2;j++)
          {

              if((m-i)%j==0)
                {
                    p=(m-i)/j;
                    if(p>=l&&p<=r)
                    {
                   // cout<<(m-i)<<" "<<j<<endl;
                    if(i<0)
                    res=r;
                    else
                    res=l;

                     cout<<(m-i)/j<<" "<<res+i<<" "<<res<<endl;
                        ok=1;
                        break;
                    }

                }
          }
           if(ok==1)
                break;

          }

      }

 }


#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define run  ios_base::sync_with_stdio(false);cin.tie(NULL);

int main()
 {
  run;
  ll t;
  cin>>t;
  while(t--)
  {
      ll l,r,m,i,p,ok=0,res,res1,x,y;
      cin>>l>>r>>m;

      for(ll i=l;i<=r;i++)
        {
            x=m%i;

            if((x<=(r-l))&(m-x!=0))
            {
                printf("%lld %lld %lld\n",i,r,r-x);
                break;
            }
            else if((i-x)<=(r-l))
            {
                printf("%lld %lld %lld\n",i,l,l+(i-x));
                break;
            }
        }

  }
 }


#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define run  ios_base::sync_with_stdio(false);cin.tie(NULL);

int main()
 {
  run;
  ll t;
  cin>>t;
  while(t--)
  {
      ll l,r,m,i,ok=0,j,x,y;
      cin>>l>>r>>m;

      y=l-r;
      x=r-l;

      for(i=y;i<=x;i++)
      {
          for(j=l;j<=r;j++)
          {
              if((m+i)%j==0)
                {
                    cout<<j<<" "<<l<<" "<<l+i<<endl;
                    ok=1;
                    break;
                }

          }
           if(ok==1)
                break;

      }
  }

 }


#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define run  ios_base::sync_with_stdio(false);cin.tie(NULL);

int main()
 {
  run;
  ll t;
  cin>>t;
  while(t--)
  {
      ll l,r,m,i,ok=0,j,x,y;
      cin>>l>>r>>m;

      y=l-r;
      x=r-l;

      for(i=x;i>=y;i--)
      {
          for(j=l;j<=r;j++)
          {
              if((m+i)%j==0)
                {
                    cout<<j<<" "<<l<<" "<<l+i<<endl;
                    ok=1;
                    break;
                }

          }
           if(ok==1)
                break;

      }
  }

 }


#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define run  ios_base::sync_with_stdio(false);cin.tie(NULL);

int main()
 {
  run;
  ll t;
  cin>>t;
  while(t--)
  {
      ll l,r,m,i,p,ok=0;
      cin>>l>>r>>m;

      for(i=l;i<=r;i++)
      {
          p=m%i;
          if(m-p!=0&&i-p>=l&&i-p<=r)
          {
              cout<<i<<" "<<i<<" "<<i-p<<endl;

          }
          else if(m+i+p!=0&&2*i-m%i>=l&&2*i-m%i<=r)
          {
              cout<<i<<" "<<i<<" "<<2*i-p<<endl;
              break;

          }

      }

  }
 }


#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define run  ios_base::sync_with_stdio(false);cin.tie(NULL);

int main()
 {
  run;
  ll t;
  cin>>t;
  while(t--)
  {
      ll l,r,m,i,p,ok=0;
      cin>>l>>r>>m;

      for(i=l;i<=r;i++)
      {
          p=m%i;
          if(m-p!=0)
          {

              cout<<i<<" "<<i<<" "<<i-p<<endl;
              break;

          }
          else if((m+i+p)!=0)
          {
              cout<<i<<" "<<i<<" "<<2*i-p<<endl;
              break;

          }

      }

  }
 }


#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define run  ios_base::sync_with_stdio(false);cin.tie(NULL);

int main()
 {
  run;
  ll t;
  cin>>t;
  while(t--)
  {
      ll l,r,m,i,p,ok=0,res,res1;
      cin>>l>>r>>m;

      for(i=l;i<=r;i++)
      {
          p=m%i;
          if(m-p!=0)
          {
             if(i-p<l)
             {
                 res=r;
                 res1=res-p;
             }
             else
             {
                 res=i;
                 res1=res-p;
             }

              cout<<i<<" "<<res<<" "<<res1<<endl;
              break;

          }
          else if((m+i+p)!=0)
          {
              //cout<<2*i-p<<" ";
              if(2*i-p>r)
              {

                  res=l;
                  res1=2*l-p;

                  if(res1<l)
                   {
                       res=ceil((p+res1)/2);
                       res1=2*res-p;
                   }
              }

               else
             {
                 res=i;
                 res1=2*i-p;
             }

              cout<<i<<" "<<res<<" "<<res1<<endl;
              break;

          }

      }

  }
 }


#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define run  ios_base::sync_with_stdio(false);cin.tie(NULL);

int main()
 {
  run;
  ll t;
  cin>>t;
  while(t--)
  {
      ll l,r,m,i,ok=0,j,x,y,x1,x2,p,y1,res;
      cin>>l>>r>>m;

      y=l-r;
      x=r-l;

      y1=(m+l-r)/l;
      y1--;
      if(y1<=0)
      y1=1;
      x2=(m+r-l)/l;
      x2++;
     // cout<<y1<< " "<<x2<<" "<<endl;
      for(i=x;i>=y;i--)
      {
          for(j=y1;j<=x2;j++)
          {

              if((m-i)%j==0)
                {
                    p=(m-i)/j;
                    if(p>=l&&p<=r)
                    {
                   // cout<<(m-i)<<" "<<j<<endl;
                    if(i<0)
                    res=r;
                    else
                    res=l;

                     cout<<(m-i)/j<<" "<<res+i<<" "<<res<<endl;
                        ok=1;
                        break;
                    }

                }
          }
           if(ok==1)
                break;

          }

      }

 }


#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define run  ios_base::sync_with_stdio(false);cin.tie(NULL);

int main()
 {
  run;
  ll t;
  cin>>t;
  while(t--)
  {
      ll l,r,m,i,ok=0,j,x,y,x1,x2,p,y1,res;
      cin>>l>>r>>m;

      y=l-r;
      x=r-l;

      y1=(m+l-r)/l;
      y1--;
      if(y1<0)
      y1=1;
      x2=(m+r-l)/l;
      x2++;
     // cout<<y1<< " "<<x2<<" "<<endl;
      for(i=x;i>=y;i--)
      {
          for(j=y1;j<=x2;j++)
          {

              if((m-i)%j==0)
                {

                    p=(m-i)/j;

                    if(p>=l&&p<=r)
                    {
                   // cout<<(m-i)<<" "<<j<<endl;
                    if(i<0)
                    res=r;
                    else
                    res=l;
                     cout<<(m-i)/j<<" "<<res+i<<" "<<res<<endl;
                        ok=1;
                        break;
                    }

                }
          }
           if(ok==1)
                break;

          }

      }

 }


#include<iostream>
#include<vector>
#include<string>
#include<set>
#include<map>
#include<algorithm>
#include<cmath>
#include<unordered_map>
#include<unordered_set>
#include<bitset>
#include<sstream>
#include<numeric>
#include<queue>
#include<cstdio>
#include<iterator>
//#pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
//#pragma GCC optimize("unroll-loops")
using namespace std;
using ll = long long;
using ull = unsigned long long;

#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define pb(x) push_back(x)
ll mod = 1e9 + 7;
ll inf = 1e9 + 7;
template<typename T, typename U>
T binpow(T a, U n) {
    if (n == 0)
        return 1;
    if (n % 2 == 1)
        return (binpow(a, n - 1) * a) % mod;
    else {
        ll b = binpow(a, n / 2) % mod;
        return (b * b) % mod;
    }
}
template<typename T>
T gcd(T a, T b) {
    if (b == 0)
        return a;
    else
        return gcd(b, a % b);
}
template<typename T>
istream& operator>>(istream& str, vector<T>& vec) {
    for (auto& w : vec) str >> w;
    return str;
}
template<typename T>
ostream& operator<<(ostream& str, vector<T>& vec) {
    for (auto& w : vec) str << w << ' ';
    return str;
}

struct segtree {
    vector<set<ll>>mn;
    vector<ll>tree;
    size_t size = 1;
    //void build(ll x, ll lx, ll rx, vector<ll>& vec);
    void build(ll size_) {
        while (size < size_) {
            size *= 2;
        }
        tree.resize(size * 2 - 1);
        mn.resize(size * 2 - 1);
    }
    void update(ll i, ll x, ll v, ll lx, ll rx) {
        if (rx - lx == 1) {
            tree[x] = v;
            return;
        }
        ll m = (lx + rx) / 2;
        if (i < m) {
            update(i, 2 * x + 1, v, lx, m);
        }
        else {
            update(i, 2 * x + 2, v, m, rx);
        }
        tree[x] = tree[2 * x + 1] + tree[2 * x + 2];
    }

    ll get(ll l, ll r, ll x, ll lx, ll rx) {
        if (l <= lx && rx <= r) return tree[x];
        if (rx <= l || lx >= r) return 0;
        ll m = (lx + rx) / 2;
        return get(l, r, 2 * x + 1, lx, m) + get(l, r, 2 * x + 2, m, rx);
    }
};

signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    ll t;
    cin >> t;
    while (t--) {
        ll l, r, m;
        cin >> l >> r >> m;
        ll lx = 0, rx = 1e13;
        ll maxv = m + r - l, minv = m - r + l;
        ll ans = -1;
        ll a = -1, b = -1, c = -1, n = -1;
        for (int i = 1; i < 1e5; ++i) {
            ll mid = i;
            ll minn = mid * l, maxx = mid * r;
            ll ly = l - 1, ry = r;
            while (ry - ly > 1) {
                ll midd = (ry + ly) / 2;
                if (mid * midd < minv) {
                    ly = midd;
                }
                else {
                    ry = midd;
                }
            }
            if (minv <= mid * ry && mid * ry <= maxv && n == -1) {
                n = mid; a = ry;
            }
        }
        ll gg = n * a - m;
        ll dif = r - l - gg;
        if (r - dif >= l && r - dif <= r) {
            b = l; c = r - dif;
        }
        dif = gg - (l - r);
        if (l + dif <= r && l + dif >= l) {
            b = r; c = l + dif;
        }
        cout << a << ' ' << b << ' ' << c << '\n';
    }

}


#include<iostream>
#include<algorithm>

int main()
{
   int q;
   scanf("%d", &q);

    for (int i = 0; i < q; ++i)
    {
        long long a, b, c;
        scanf("%ld%ld%ld", &a, &b, &c);

        long long sol = (a + b +c) / 2;
        printf("%ld\n",sol);
    }

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
     int t;
  cin >> t;
  while (t--) {
    int b, p, f;
    cin >> b >> p >> f;
    int h, c;
    cin >> h >> c;
    int ans = 0;
    if (h > c) {
      ans += h * min(b / 2, p);
      b -= 2 * min(b / 2, p);
      ans += c * min(b / 2, f);
      b -= 2 * min(b / 2, f);
    } else {
      ans += c * min(b / 2, f);
      b -= 2 * min(b / 2, f);
      ans += h * min(b / 2, p);
      b -= 2 * min(b / 2, p);
    }
    cout << ans << endl;
  }
  return 0;
}
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
    ll n,i;
    ll a[3];

    cin>>n;

ll k=0;
    while( k< n)
    {
    for(ll i=0;i<3;i++)
    {
     cin>>a[i];
    }
    ll ans=(a[0]+a[1]+a[2])/2;
     cout<<ans<<'\n';

    k++;
    }
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n ,i;
    int a[3];

    cin>>n;

int k=0;
    while(k<n)
    {
    for(i=0;i<3;i++)
    {
     cin>>a[i]
    int ans=a[0]+a[1]+a[2]/2;
     cout<<ans;
    }
    k++;
    }


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n ,i;
    int a[3];

    cin>>n;

int k=0;
    while(k<n)
    {
    for(i=0;i<3;i++)
    {
     cin>>a[i]
    int ans=(a[0]+a[1]+a[2])/2;
     cout<<ans<<'/n';
    }
    k++;
    }


#include<bits/stdc++.h>
int main()
{
    int n ,i;
    int a[3];
    cout<<"enter the no. of queries"<<endl;
    cin>>n;

    k=0;
    while(k==n)
    {
    for(i=0;i<3;i++)
    {
     cin>>a[i]
    int ans=a[0]+a[1]+a[2]/2;
     cout<<ans;
    }
    k++;
    }


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n ,i;
    int a[3];

    cin>>n;

int k=0;
    while(k<n)
    {
    for(i=0;i<3;i++)
    {
     cin>>a[i];
    }
    int ans=(a[0]+a[1]+a[2])/2;
     cout<<ans<<'\n';

    k++;
    }
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n ,i;
    int a[3];

    cin>>n;

int k=0;
    while(k<n)
    {
    for(i=0;i<3;i++)
    {
     cin>>a[i]
    int ans=a[0]+a[1]+a[2]/2;
     cout<<ans<<'/n';
    }
    k++;
    }


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n ,i;
    int a[3];

    cin>>n;

int k=0;
    while(k<n)
    {
    for(i=0;i<3;i++)
    {
     cin>>a[i]
    int ans=a[0]+a[1]+a[2]%2;
     cout<<ans;
    }
    k++;
    }


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n ,i;
    int a[3];

    cin>>n;

int k=0;
    while(k<n)
    {
    for(i=0;i<3;i++)
    {
     cin>>a[i]
    }
    int ans=(a[0]+a[1]+a[2])/2;
     cout<<ans<<'/n';

    k++;
    }
}


#include<bits/stdc++.h>
using namespace std;
#define int long long;
int main()
{
    int n,i;
    int a[3];

    cin>>n;

int k=0;
    while( k< n)
    {
    for(int i=0;i<3;i++)
    {
     cin>>a[i];
    }
    int ans=(a[0]+a[1]+a[2])/2;
     cout<<ans<<'\n';

    k++;
    }
}


#include <stdio.h>
#include <iostream>

using namespace std;

int main()
{
    int q;
    long long int a, b, c, sum;
    cin >> q;
    while(q--) {
        cin >> a >> b >> c;
        sum = a + b + c;
        cout << (a + b + c)/2;
    }
    return 0;
}


#include <stdio.h>
#include <iostream>

using namespace std;

int main()
{
    int q;
    long long int a, b, c, sum;
    cin >> q;
    while(q--) {
        cin >> a >> b >> c;
        sum = a + b + c;
        cout << (a + b + c)/2 << endl;
    }
    return 0;
}


#include <stdio.h>
#include <iostream>
#include <math.h>

using namespace std;

int main()
{
    double q, a, b, c, sum = 0, max, mid, min, alice = 0, bob = 0;
    cin >> q;
    while(q--) {
        cin >> a >> b >> c;
        sum = a + b + c;
        if(fmod(sum,2) == 0) {
            printf("%.0lf\n",(sum/2));
        }
        else if(a > b && a > c) {
            if(b > c) {
                mid = b;
                min = c;
            }
            else {
                mid = c;
                min = b;
            }
            max = a;
            if(fmod(max,2) == 1) {
                alice++;
                max--;
            }
            alice += mid;
            bob += min;
            while(alice != bob) {
                bob++;
                max--;
            }
            if(fmod(max,2) == 1) {
                alice++;
                max--;
            }
            while(max != 0) {
                alice++;
                bob++;
                max = max - 2;
            }
            if(alice > bob) {
                alice--;
            }
            cout << (int)alice << endl;
        }
        else if(b > a && b > c) {
            if(a > c) {
                mid = a;
                min = c;
            }
            else {
                mid = c;
                min = a;
            }
            max = b;
            if(fmod(max,2) == 1) {
                alice++;
                max--;
            }
            alice += mid;
            bob += min;
            while(alice != bob) {
                bob++;
                max--;
            }
            if(fmod(max,2) == 1) {
                alice++;
                max--;
            }
            while(max != 0) {
                alice++;
                bob++;
                max = max - 2;
            }
            if(alice > bob) {
                alice--;
            }
            cout << (int)alice << endl;
        }
        else if(c > a && c > b) {
            if(b > a) {
                mid = b;
                min = a;
            }
            else {
                mid = a;
                min = b;
            }
            max = c;
            if(fmod(max,2) == 1) {
                alice++;
                max--;
            }
            alice += mid;
            bob += min;
            while(alice != bob) {
                bob++;
                max--;
            }
            if(fmod(max,2) == 1) {
                alice++;
                max--;
            }
            while(max != 0) {
                alice++;
                bob++;
                max = max - 2;
            }
            if(alice > bob) {
                alice--;
            }
            cout << (int)alice << endl;
        }
    }
    return 0;
}


#include <stdio.h>
#include <iostream>
#include <math.h>

using namespace std;

int main()
{
    double q, a, b, c, sum = 0, max, mid, min, alice = 0, bob = 0;
    cin >> q;
    while(q--) {
        cin >> a >> b >> c;
        sum = a + b + c;
        if(fmod(sum,2) == 0) {
            cout << fixed << (int)sum/2 << endl;
        }
        else if(a > b && a > c) {
            if(b > c) {
                mid = b;
                min = c;
            }
            else {
                mid = c;
                min = b;
            }
            max = a;
            if(fmod(max,2) == 1) {
                alice++;
                max--;
            }
            alice += mid;
            bob += min;
            while(alice != bob) {
                bob++;
                max--;
            }
            if(fmod(max,2) == 1) {
                alice++;
                max--;
            }
            while(max != 0) {
                alice++;
                bob++;
                max = max - 2;
            }
            if(alice > bob) {
                alice--;
            }
            cout << (int)alice << endl;
        }
        else if(b > a && b > c) {
            if(a > c) {
                mid = a;
                min = c;
            }
            else {
                mid = c;
                min = a;
            }
            max = b;
            if(fmod(max,2) == 1) {
                alice++;
                max--;
            }
            alice += mid;
            bob += min;
            while(alice != bob) {
                bob++;
                max--;
            }
            if(fmod(max,2) == 1) {
                alice++;
                max--;
            }
            while(max != 0) {
                alice++;
                bob++;
                max = max - 2;
            }
            if(alice > bob) {
                alice--;
            }
            cout << (int)alice << endl;
        }
        else if(c > a && c > b) {
            if(b > a) {
                mid = b;
                min = a;
            }
            else {
                mid = a;
                min = b;
            }
            max = c;
            if(fmod(max,2) == 1) {
                alice++;
                max--;
            }
            alice += mid;
            bob += min;
            while(alice != bob) {
                bob++;
                max--;
            }
            if(fmod(max,2) == 1) {
                alice++;
                max--;
            }
            while(max != 0) {
                alice++;
                bob++;
                max = max - 2;
            }
            if(alice > bob) {
                alice--;
            }
            cout << (int)alice << endl;
        }
    }
    return 0;
}


#include <stdio.h>
#include <iostream>

using namespace std;

int main()
{
    int q, a, b, c, sum = 0, max, mid, min, alice = 0, bob = 0;
    cin >> q;
    while(q--) {
        cin >> a >> b >> c;
        sum = a + b + c;
        if(sum % 2 == 0) {
            cout << sum/2 << endl;
        }
        else if(a > b && a > c) {
            if(b > c) {
                mid = b;
                min = c;
            }
            else {
                mid = c;
                min = b;
            }
            max = a;
            if(max % 2 == 1) {
                alice++;
                max--;
            }
            alice += mid;
            bob += min;
            while(alice != bob) {
                bob++;
                max--;
            }
            if(max % 2 == 1) {
                alice++;
                max--;
            }
            while(max != 0) {
                alice++;
                bob++;
                max = max - 2;
            }
            if(alice > bob) {
                alice--;
            }
            cout << alice << endl;
        }
        else if(b > a && b > c) {
            if(a > c) {
                mid = a;
                min = c;
            }
            else {
                mid = c;
                min = a;
            }
            max = b;
            if(max % 2 == 1) {
                alice++;
                max--;
            }
            alice += mid;
            bob += min;
            while(alice != bob) {
                bob++;
                max--;
            }
            if(max % 2 == 1) {
                alice++;
                max--;
            }
            while(max != 0) {
                alice++;
                bob++;
                max = max - 2;
            }
            if(alice > bob) {
                alice--;
            }
            cout << alice << endl;
        }
        else if(c > a && c > b) {
            if(b > a) {
                mid = b;
                min = a;
            }
            else {
                mid = a;
                min = b;
            }
            max = c;
            if(max % 2 == 1) {
                alice++;
                max--;
            }
            alice += mid;
            bob += min;
            while(alice != bob) {
                bob++;
                max--;
            }
            if(max % 2 == 1) {
                alice++;
                max--;
            }
            while(max != 0) {
                alice++;
                bob++;
                max = max - 2;
            }
            if(alice > bob) {
                alice--;
            }
            cout << alice << endl;
        }
    }
    return 0;
}


#include <stdio.h>
#include <iostream>
#include <math.h>

using namespace std;

int main()
{
    double q, a, b, c, sum = 0, max, mid, min, alice = 0, bob = 0;
    cin >> q;
    while(q--) {
        cin >> a >> b >> c;
        sum = a + b + c;
        if(fmod(sum,2) == 0) {
            cout << sum/2 << endl;
        }
        else if(a > b && a > c) {
            if(b > c) {
                mid = b;
                min = c;
            }
            else {
                mid = c;
                min = b;
            }
            max = a;
            if(fmod(max,2) == 1) {
                alice++;
                max--;
            }
            alice += mid;
            bob += min;
            while(alice != bob) {
                bob++;
                max--;
            }
            if(fmod(max,2) == 1) {
                alice++;
                max--;
            }
            while(max != 0) {
                alice++;
                bob++;
                max = max - 2;
            }
            if(alice > bob) {
                alice--;
            }
            cout << alice << endl;
        }
        else if(b > a && b > c) {
            if(a > c) {
                mid = a;
                min = c;
            }
            else {
                mid = c;
                min = a;
            }
            max = b;
            if(fmod(max,2) == 1) {
                alice++;
                max--;
            }
            alice += mid;
            bob += min;
            while(alice != bob) {
                bob++;
                max--;
            }
            if(fmod(max,2) == 1) {
                alice++;
                max--;
            }
            while(max != 0) {
                alice++;
                bob++;
                max = max - 2;
            }
            if(alice > bob) {
                alice--;
            }
            cout << alice << endl;
        }
        else if(c > a && c > b) {
            if(b > a) {
                mid = b;
                min = a;
            }
            else {
                mid = a;
                min = b;
            }
            max = c;
            if(fmod(max,2) == 1) {
                alice++;
                max--;
            }
            alice += mid;
            bob += min;
            while(alice != bob) {
                bob++;
                max--;
            }
            if(fmod(max,2) == 1) {
                alice++;
                max--;
            }
            while(max != 0) {
                alice++;
                bob++;
                max = max - 2;
            }
            if(alice > bob) {
                alice--;
            }
            cout << alice << endl;
        }
    }
    return 0;
}


#include <stdio.h>
#include <iostream>
#include <math.h>

using namespace std;

int main()
{
    double q, a, b, c, sum = 0, max, mid, min, alice = 0, bob = 0;
    cin >> q;
    while(q--) {
        cin >> a >> b >> c;
        sum = a + b + c;
        if(fmod(sum,2) == 0) {
            cout << fixed << sum/2 << endl;
        }
        else if(a > b && a > c) {
            if(b > c) {
                mid = b;
                min = c;
            }
            else {
                mid = c;
                min = b;
            }
            max = a;
            if(fmod(max,2) == 1) {
                alice++;
                max--;
            }
            alice += mid;
            bob += min;
            while(alice != bob) {
                bob++;
                max--;
            }
            if(fmod(max,2) == 1) {
                alice++;
                max--;
            }
            while(max != 0) {
                alice++;
                bob++;
                max = max - 2;
            }
            if(alice > bob) {
                alice--;
            }
            cout << alice << endl;
        }
        else if(b > a && b > c) {
            if(a > c) {
                mid = a;
                min = c;
            }
            else {
                mid = c;
                min = a;
            }
            max = b;
            if(fmod(max,2) == 1) {
                alice++;
                max--;
            }
            alice += mid;
            bob += min;
            while(alice != bob) {
                bob++;
                max--;
            }
            if(fmod(max,2) == 1) {
                alice++;
                max--;
            }
            while(max != 0) {
                alice++;
                bob++;
                max = max - 2;
            }
            if(alice > bob) {
                alice--;
            }
            cout << alice << endl;
        }
        else if(c > a && c > b) {
            if(b > a) {
                mid = b;
                min = a;
            }
            else {
                mid = a;
                min = b;
            }
            max = c;
            if(fmod(max,2) == 1) {
                alice++;
                max--;
            }
            alice += mid;
            bob += min;
            while(alice != bob) {
                bob++;
                max--;
            }
            if(fmod(max,2) == 1) {
                alice++;
                max--;
            }
            while(max != 0) {
                alice++;
                bob++;
                max = max - 2;
            }
            if(alice > bob) {
                alice--;
            }
            cout << alice << endl;
        }
    }
    return 0;
}


/**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  Name:- OMHARI
  Institution:- UNIVERSIT OF CALCUTTA(INFORMATION TECHNOLOGY)
  Email:- omharicu@gmail.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~**/
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include<bits/stdc++.h>
using namespace __gnu_pbds;
using namespace std;
//------------------------------------Define------------------------------------------------------
#define F               first
#define S               second
#define int             long long // Warning
#define ull             unsigned long long
#define db              long double
#define ST              string
#define pb              push_back
#define mp              make_pair
#define el              "\n"
#define vi              vector <int>
#define vt              vector
#define pii             pair <int, int>
#define mii             map<int, int>
#define mxHeap          priority_queue<int>
#define mnHeap          priority_queue<int, vi, greater<int> >
#define vec(v)          vector <v>
#define sz(v)           (v.size())
#define all(v)          v.begin(), v.end()
#define rall(v)         v.rbegin(), v.rend()
#define is_sort(v)      is_sorted (all(v))
#define max_of(v)       *max_element (all(v))
#define min_of(v)       *min_element (all(v))
#define itos(s)         to_string(s)
#define cntone(x)       __builtin_popcountll(x) // 64-bit
#define cntzro(x)       __builtin_clzll(x)      // 64-bit
#define clr(x,y) 	    memset(x, y, sizeof(x))
#define fil(x,y) 	    fill(all(x), y)
#define deb1(x)         cerr<<#x<<" = "<<x<<el
#define deb2(x, y)      cerr<<#x<<" = "<<x<<" and "<<#y<<" = "<<y<<el
#define For(i, a, b)    for(int i=a; i<b; i++)
#define Forr(i, a, b)   for(int i=a; i>=b; i--)
#define FAST            ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
//------------------------------------------------------------------------------------------------
//-------------------------------------Constant---------------------------------------------------
const db PI = acos(-1.0);
const int mod = 1e9+7;
const int dx[8] = {1, -1, 0, 0, 1, 1, -1, -1};
const int dy[8] = {0, 0, 1, -1, 1, -1, -1, 1};
//                {R, L, U, D, RD, RU, LU, LD}
//------------------------------------------------------------------------------------------------
//------------------------------------Functions---------------------------------------------------
void IO(){
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
    #endif
    }
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
int myRand(int A, int B) {return A+(ull)rng() % B;}
inline int addM(int a, int b) { return ((a % mod) + (b % mod)) % mod; }
inline int subM(int a, int b) { return ((a % mod) - (b % mod) + mod) % mod; }
inline int mulM(int a, int b) { return ((a % mod) * (b % mod)) % mod; }
inline int powM(int a, int b)
{ int ans=1; while(b){ if(b&1)ans*=a; ans%=mod; a*=a; a%=mod; b=b>>1; } return ans; }
//-----------------------------------------------------------------------------------------------
//------------------------------------Template---------------------------------------------------
template <typename T> istream &operator>>(istream &in, vector<T> &vec)
{for (auto &v : vec) in>>v; return in;} //Vector input
template <typename T> ostream& operator<<(ostream &out, vector<T> &vec)
{for (auto &v : vec) out<<v<<" "; return out;} //Vector output
template<typename T1,typename T2>istream& operator>>(istream& in,pair<T1,T2> &a)
{in>>a.first>>a.second;return in;}
template<typename T1,typename T2>ostream& operator<<(ostream& out,pair<T1,T2> a)
{out<<a.first<<" "<<a.second;return out;}
template <typename... T>
void read(T&... args){((cin>>args), ...);}
template <typename... T>
void write(T&&... args){((cout<<args<<" "), ...);}
//ordered_set s;
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;
//order_of_key (k) : Number of items strictly smaller than k .
//find_by_order(k) : K-th element in a set (counting from zero).
//------------------------------------------------------------------------------------------------

void solve()
{
    vi v(3);
    cin>>v;
    cout<<(v[0]+v[1]+v[2])/2<<el;
}

int32_t main()
{
    FAST;
    IO();
    // cout<<fixed<<setprecision(20);

    /***************-Multiple test case-***************/
    int t;
    cin>>t;
    while(t--)
    solve();
    return 0;
}


/**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  Name:- OMHARI
  Institution:- UNIVERSIT OF CALCUTTA(INFORMATION TECHNOLOGY)
  Email:- omharicu@gmail.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~**/
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include<bits/stdc++.h>
using namespace __gnu_pbds;
using namespace std;
//------------------------------------Define------------------------------------------------------
#define F               first
#define S               second
#define int             long long // Warning
#define ull             unsigned long long
#define db              long double
#define ST              string
#define pb              push_back
#define mp              make_pair
#define el              "\n"
#define vi              vector <int>
#define vt              vector
#define pii             pair <int, int>
#define mii             map<int, int>
#define mxHeap          priority_queue<int>
#define mnHeap          priority_queue<int, vi, greater<int> >
#define vec(v)          vector <v>
#define sz(v)           (v.size())
#define all(v)          v.begin(), v.end()
#define rall(v)         v.rbegin(), v.rend()
#define is_sort(v)      is_sorted (all(v))
#define max_of(v)       *max_element (all(v))
#define min_of(v)       *min_element (all(v))
#define itos(s)         to_string(s)
#define cntone(x)       __builtin_popcountll(x) // 64-bit
#define cntzro(x)       __builtin_clzll(x)      // 64-bit
#define clr(x,y) 	    memset(x, y, sizeof(x))
#define fil(x,y) 	    fill(all(x), y)
#define deb1(x)         cerr<<#x<<" = "<<x<<el
#define deb2(x, y)      cerr<<#x<<" = "<<x<<" and "<<#y<<" = "<<y<<el
#define For(i, a, b)    for(int i=a; i<b; i++)
#define Forr(i, a, b)   for(int i=a; i>=b; i--)
#define FAST            ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
//------------------------------------------------------------------------------------------------
//-------------------------------------Constant---------------------------------------------------
const db PI = acos(-1.0);
const int mod = 1e9+7;
const int dx[8] = {1, -1, 0, 0, 1, 1, -1, -1};
const int dy[8] = {0, 0, 1, -1, 1, -1, -1, 1};
//                {R, L, U, D, RD, RU, LU, LD}
//------------------------------------------------------------------------------------------------
//------------------------------------Functions---------------------------------------------------
void IO(){
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
    #endif
    }
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
int myRand(int A, int B) {return A+(ull)rng() % B;}
inline int addM(int a, int b) { return ((a % mod) + (b % mod)) % mod; }
inline int subM(int a, int b) { return ((a % mod) - (b % mod) + mod) % mod; }
inline int mulM(int a, int b) { return ((a % mod) * (b % mod)) % mod; }
inline int powM(int a, int b)
{ int ans=1; while(b){ if(b&1)ans*=a; ans%=mod; a*=a; a%=mod; b=b>>1; } return ans; }
//-----------------------------------------------------------------------------------------------
//------------------------------------Template---------------------------------------------------
template <typename T> istream &operator>>(istream &in, vector<T> &vec)
{for (auto &v : vec) in>>v; return in;} //Vector input
template <typename T> ostream& operator<<(ostream &out, vector<T> &vec)
{for (auto &v : vec) out<<v<<" "; return out;} //Vector output
template<typename T1,typename T2>istream& operator>>(istream& in,pair<T1,T2> &a)
{in>>a.first>>a.second;return in;}
template<typename T1,typename T2>ostream& operator<<(ostream& out,pair<T1,T2> a)
{out<<a.first<<" "<<a.second;return out;}
template <typename... T>
void read(T&... args){((cin>>args), ...);}
template <typename... T>
void write(T&&... args){((cout<<args<<" "), ...);}
//ordered_set s;
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;
//order_of_key (k) : Number of items strictly smaller than k .
//find_by_order(k) : K-th element in a set (counting from zero).
//------------------------------------------------------------------------------------------------

void solve()
{
    vi v(3);
    cin>>v;
    sort(rall(v));
    int a, b;
    if(v[0]-v[1]<=v[1]-v[2])
    {
        a=v[0];
        b=v[1];
        int c=abs(a-b);

        if(c>v[2])
        cout<<(v[2]+v[1])<<el;
        else
        cout<<a+((v[2]-c)/2)<<el;
    }
    else
    {
        a=v[1];
        b=v[2];
        int c=abs(a-b);

        if(c>v[0])
        cout<<(v[2]+v[0])<<el;
        else
        cout<<a+((v[0]-c)/2)<<el;
    }

}

int32_t main()
{
    FAST;
    IO();
    // cout<<fixed<<setprecision(20);

    /***************-Multiple test case-***************/
    int t;
    cin>>t;
    while(t--)
    solve();
    return 0;
}


/**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  Name:- OMHARI
  Institution:- UNIVERSIT OF CALCUTTA(INFORMATION TECHNOLOGY)
  Email:- omharicu@gmail.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~**/
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include<bits/stdc++.h>
using namespace __gnu_pbds;
using namespace std;
//------------------------------------Define------------------------------------------------------
#define F               first
#define S               second
#define int             long long // Warning
#define ull             unsigned long long
#define db              long double
#define ST              string
#define pb              push_back
#define mp              make_pair
#define el              "\n"
#define vi              vector <int>
#define vt              vector
#define pii             pair <int, int>
#define mii             map<int, int>
#define mxHeap          priority_queue<int>
#define mnHeap          priority_queue<int, vi, greater<int> >
#define vec(v)          vector <v>
#define sz(v)           (v.size())
#define all(v)          v.begin(), v.end()
#define rall(v)         v.rbegin(), v.rend()
#define is_sort(v)      is_sorted (all(v))
#define max_of(v)       *max_element (all(v))
#define min_of(v)       *min_element (all(v))
#define itos(s)         to_string(s)
#define cntone(x)       __builtin_popcountll(x) // 64-bit
#define cntzro(x)       __builtin_clzll(x)      // 64-bit
#define clr(x,y) 	    memset(x, y, sizeof(x))
#define fil(x,y) 	    fill(all(x), y)
#define deb1(x)         cerr<<#x<<" = "<<x<<el
#define deb2(x, y)      cerr<<#x<<" = "<<x<<" and "<<#y<<" = "<<y<<el
#define For(i, a, b)    for(int i=a; i<b; i++)
#define Forr(i, a, b)   for(int i=a; i>=b; i--)
#define FAST            ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
//------------------------------------------------------------------------------------------------
//-------------------------------------Constant---------------------------------------------------
const db PI = acos(-1.0);
const int mod = 1e9+7;
const int dx[8] = {1, -1, 0, 0, 1, 1, -1, -1};
const int dy[8] = {0, 0, 1, -1, 1, -1, -1, 1};
//                {R, L, U, D, RD, RU, LU, LD}
//------------------------------------------------------------------------------------------------
//------------------------------------Functions---------------------------------------------------
void IO(){
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
    #endif
    }
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
int myRand(int A, int B) {return A+(ull)rng() % B;}
inline int addM(int a, int b) { return ((a % mod) + (b % mod)) % mod; }
inline int subM(int a, int b) { return ((a % mod) - (b % mod) + mod) % mod; }
inline int mulM(int a, int b) { return ((a % mod) * (b % mod)) % mod; }
inline int powM(int a, int b)
{ int ans=1; while(b){ if(b&1)ans*=a; ans%=mod; a*=a; a%=mod; b=b>>1; } return ans; }
//-----------------------------------------------------------------------------------------------
//------------------------------------Template---------------------------------------------------
template <typename T> istream &operator>>(istream &in, vector<T> &vec)
{for (auto &v : vec) in>>v; return in;} //Vector input
template <typename T> ostream& operator<<(ostream &out, vector<T> &vec)
{for (auto &v : vec) out<<v<<" "; return out;} //Vector output
template<typename T1,typename T2>istream& operator>>(istream& in,pair<T1,T2> &a)
{in>>a.first>>a.second;return in;}
template<typename T1,typename T2>ostream& operator<<(ostream& out,pair<T1,T2> a)
{out<<a.first<<" "<<a.second;return out;}
template <typename... T>
void read(T&... args){((cin>>args), ...);}
template <typename... T>
void write(T&&... args){((cout<<args<<" "), ...);}
//ordered_set s;
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;
//order_of_key (k) : Number of items strictly smaller than k .
//find_by_order(k) : K-th element in a set (counting from zero).
//------------------------------------------------------------------------------------------------

void solve()
{
    vi v(3);
    cin>>v;
    //sort(rall(v));
    int ans=-1;
    do{
        int a=v[0], b=v[1];
        int c=abs(a-b);
        if(v[2]>=c)
        ans=max(ans, max(a, b)+(v[2]-c)/2);
        else
        ans=max(ans, (max(a, b)-(int)ceil((db)(c-v[2])/2)));
    }
    while (next_permutation(all(v)));
    cout<<ans<<el;
}

int32_t main()
{
    FAST;
    IO();
    // cout<<fixed<<setprecision(20);

    /***************-Multiple test case-***************/
    int t;
    cin>>t;
    while(t--)
    solve();
    return 0;
}