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

Solution 1 (runtime: 62 ms):
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
// typedef __gnu_pbds::tree<ll, __gnu_pbds::null_type, less<ll>, __gnu_pbds::rb_tree_tag, __gnu_pbds::tree_order_statistics_node_update> ordered_set;
#define pb push_back
#define ss second
#define ff first
#define db double
#define comp(v) v.begin(), v.end()
#define nline "\n"
#ifndef ONLINE_JUDGE
#define debug(x) cerr << #x <<" "; _print(x); cerr << endl;
#else
#define debug(x)
#endif
void _print(ll t) {cerr << t;}
void _print(int t) {cerr << t;}
void _print(string t) {cerr << t;}
void _print(char t) {cerr << t;}
void _print(double t) {cerr << t;}
template <class T> void _print(vector <T> v);
template <class T> void _print(vector <T> v) {cerr << "[ "; for (T i : v) {_print(i); cerr << " ";} cerr << "]";}
const ll mod = 1e9 + 7;
const ll inf = 1e17 + 2;
const ll N = 1e7 + 11;
const ll MX = 1e9 + 2;
ll add(ll x, ll y) {return ((x + y) % mod + mod) % mod;}
ll sub(ll x, ll y) {return add(x, -y);}
ll mul(ll x, ll y, ll mod) {return 1ll * x * y % mod;}
ll expo(ll a, ll b, ll mod) {ll res = 1; while (b > 0) {if (b & 1)res = (res * a) % mod; a = (a * a) % mod; b = b >> 1;} return res;}
ll ceil_div(ll a, ll b) {return a % b == 0 ? a / b : a / b + 1;}
ll gcd(ll a, ll b) {if (b == 0)return a; return gcd(b, a % b);}
ll modinv(ll n) {return expo(n, mod - 2, mod);}
// // //-------------------------------------------------------------------------------------------------------------------------------//


/*
*/

void solve() {
    ll l, r; cin >> l >> r;
    ll a = 0, b = 0, c;
    for (ll i = 30; i >= 0; i--) {
        if ((1 << i) > r) {
            continue;
        }
        //if bit is set on both the bit need to set them 1.
        if (((1 << i)&r) && ((1 << i)&l)) {
            a += (1 << i);
            b += (1 << i);
        }
        //if a bit is set in R but unset in l.
        if (((1 << i)&r) && !((1 << i)&l)) {
            a += 1 << i;
            b += (1 << i) - 1;
            break;
        }
    }
    debug(a)
    for (ll i = l; i <= r; i++) {
        if (a != i && b != i) {
            cout << a << ' ' << b << ' ' << i << nline;
            break;
        }
    }
}


int main() {
#ifndef ONLINE_JUDGE
    freopen("Error.txt", "w", stderr);
#endif
    ios_base::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);
    int t = 1; cin >> t;
    for (int i = 1; i <= t; i++) {
        solve();
    }
    return 0;
}


Solution 2 (runtime: 62 ms):
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <chrono>
#define pb push_back
#define INF 0x3f3f3f3f
#define LINF 0x3f3f3f3f3f3f3f3f
#define endl '\n'
#define ll long long
#define f first
#define fin cin
#define fout cout
#define s second
#define FAST cin.tie(0), cout.tie(0), ios::sync_with_stdio(0)
#define debug(x) cout << "DEBUG " << x << endl
#define debug2(x, y) cout << "DEBUG " << x << " " << y << endl
#define debug3(x, y, z) cout << "DEBUG " << x << " " << y << " " << z<< endl
#define debug4(x, y, z, o) cout << "DEBUG " << x << " " << y << " " << z<< " " << o << endl
#define all(x) x.begin(), x.end()
#define left esquerda
#define lb lower_bound
#define right direita
using namespace std;
void setIO(string s) {
ios_base::sync_with_stdio(0); cin.tie(0);
freopen((s+".in").c_str(),"r",stdin);
freopen((s+".out").c_str( ),"w",stdout);
}
typedef pair<ll, ll> pii;
typedef vector<vector<char>> mat;
typedef pair<int, string> pis;
const ll mod = 1e9 + 7, MAXN = 2e5 + 5;
typedef vector<int> vi;
typedef pair<int, pair<int, int>> piii;

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

    ll last = 1;
    while(last * 2 <= r) 
        last *= 2;

    if(last - 1 >= l && last + 1 <= r) {
        cout << last - 1 << " " << last << " " << last + 1 << endl;
        return;
    }

    if(last == r) {
        cout << l << " " << last - 1 << " " << last << endl;
        return;
    }

    int best = r;
    for(int i = 31; i >= 0; i--) {
        int aux = (1<<i);
        if( (r & aux) && best - aux >= l ) 
            best -= (1 << i);
    }

    cout << best << " " << r << " " << r << endl;


    
}

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