Problem: 2057C - Trip to the Olympiad
Language: c++17 

Solution 1 (runtime: 77 ms):
#include <cstdio>
#include <cstring>
#include<bits/stdc++.h>
using namespace std;

#define int long long
#define nl cout<<endl
#define vec vector<int>
#define vecs vector<string>
#define ddv vector<vec>
#define ub upper_bound 
#define lb lower_bound
#define prnt(v) for(auto i:v) cout<<i<<" "; nl
#define inp(v); for(auto &i:v) cin>>i;
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define pb push_back
#define ppb pop_back
#define F first
#define S second
#define yes cout<<"YES"<<endl
#define no cout<<"NO"<<endl

const int M = 1e9+7;

void solve(){
    int l,r;
    cin>>l>>r;

    int i=30;

    int a=0,b=0,c;

    // cout<<((1<<i))<<endl;

    while(((1<<i)&l) == ((1<<i)&r)){
        if((1<<i)&l) a += (1<<i);
        --i;
    }

    //
    // cout<<i<<endl;

    b = a;
    a += (1<<i);
    b += (1<<i)-1;
    
    if(b>l) c = b - 1;
    else c = a + 1;

    cout<<a<<" "<<b<<" "<<c<<endl;
}

int32_t main(){
    ios_base::sync_with_stdio(0);
    cin.tie(nullptr);

    // FACT();
    // FACTINV();
    // SIEVE();
    
    int t;
    cin>>t;
 
    while(t--){
        solve();
    }
 
    return 0;
}


Solution 2 (runtime: 109 ms):
/*
 ---------------------------------------
( If you don't fail at least 90% of the )
( time, you're not aiming high enough.  )
(                                       )
( - Alan Kay                            )
 ---------------------------------------
*/
#include<bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define ordered_set_increasing1 tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
#define ordered_set_increasing2 tree<int, null_type,less_equal<int>, rb_tree_tag,tree_order_statistics_node_update>
#define ordered_set_decreasing1 tree<int, null_type,greater<int>, rb_tree_tag, tree_order_statistics_node_update>
#define ordered_set_decreasing2 tree<int, null_type,greater_equal<int>, rb_tree_tag, tree_order_statistics_node_update>
#define pb push_back
#define all(x) (x).begin(),(x).end()
#define allr(x) (x).rbegin(),(x).rend()
#define faster ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define               ff      first
#define               ss      second
#define cost (ll)1000000000000
#define sum(a)     ( accumulate ((a).begin(), (a).end(), 0ll))
#define mine(a)    (*min_element((a).begin(), (a).end()))
#define maxe(a)    (*max_element((a).begin(), (a).end()))
#define mini(a)    ( min_element((a).begin(), (a).end()) - (a).begin())
#define maxi(a)    ( max_element((a).begin(), (a).end()) - (a).begin())
#define lowb(a, x) ( lower_bound((a).begin(), (a).end(), (x)) - (a).begin())
#define uppb(a, x) ( upper_bound((a).begin(), (a).end(), (x)) - (a).begin())
typedef long long ll;
typedef   vector <int> vi;
typedef   vector <long long int> vl;

constexpr int mod = 1000000007;
constexpr int inf = 1E9;
long long fac[200005], finv[200005], inv[200005];

void COMinit() // need to call from main function
{
    fac[0] = fac[1] = finv[0] = finv[1] = inv[1] = 1;
    for (int i = 2; i < 200005; i++)
    {
        fac[i] = fac[i - 1] * i % mod;
        inv[i] = mod - inv[mod % i] * (mod / i) % mod;
        finv[i] = finv[i - 1] * inv[i] % mod;
    }
}

long long COM(int n, int k)
{
    if (n < k) return 0;
    if (n < 0 | k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % mod) % mod;
}

int countDigit(long long n) {
  return floor(log10(n) + 1);
}
ll check_power_of_two(ll x)
{
    bool px;
    px = (x&(x-1));
    return px; // px =0, yes; otherwise no
}
//::::::::::::::::::::::::::::::::::::::::::::

/*

0. First of all, look at the given constrain
1. Think Greedy
2. Think Brute Force
3. Think solution in reverse order
4. precompute in main function
5. binary search
6. Think DP [ check constraints carefully ]
7. Check base cases for DP and prove solution for Greedy
8. Think Graph
9. priority_queue<ll>a
10. multiset<ll>
*/

void solve()
{
    ll l, r;
    cin >> l >> r;

    ll k = l ^ r;

    ll a =0, b=0, c=0;

    bool f=0;

    for(ll i= 29; i>=0; i--)
    {
        if(f)
        {
            b += 1ll*(1<<i);
            continue;
        }
        if((k >> i)&1)
        {
            f=1;
            a += 1ll*(1<<i);
        }
        else
        {
            if((l>>i)&1)
            {
                ll m = 1 <<i;
                a += m;
                b += m;
            }
        }
    }
    for(ll i=l; i<=r; i++)
    {
        if(i != a && i != b)
        {
            c = i;
            break;
        }
    }
    cout << a << ' ' << b << ' ' << c << endl;
}
int main()
{
    ll t;
    cin >> t;
    while(t--)
        solve();
}