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

Solution 1 (runtime: 93 ms):
#include <bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
// #pragma GCC optimize("Ofast")
// #pragma GCC optimize("unroll-loops")

using namespace std;
// using namespace __gnu_pbds;

#define ll long long
#define f(i, n) for (ll i = 0; i < n; i++)
#define ia(a, n) \
    ll a[n];     \
    f(i, n) cin >> a[i]
#define MOD 1000000007

// template <typename T>
// using os = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

// template <typename T>
// using oms = tree<T, null_type, less_equal<T>, rb_tree_tag, tree_order_statistics_node_update>;
// set<ll> setpp;
vector<ll> primes;
void seive_of_eratosthenes()
{
    bool isprimearr[1000001];
    f(i, 1000001) isprimearr[i] = true;
    isprimearr[0] = isprimearr[1] = false;
    for (ll i = 2; i * i <= 1000002; i++)
    {
        if (isprimearr[i])
        {
            for (ll j = i * i; j < 1000001; j += i)
                isprimearr[j] = false;
        }
    }
    f(i, 1000001)
    {
        if (isprimearr[i])
        {
            primes.push_back(i);
            // setpp.insert(i);
        }
    }
}

ll power(ll a, ll b, ll mod = 0)
{
    ll result = 1;
    if (mod == 0)
    {
        while (b)
        {
            if (b & 1)
                result *= a;
            a *= a;
            b = b >> 1;
        }
    }
    else
    {
        while (b)
        {
            if (b & 1)
            {
                result *= a;
                result = result % mod;
            }
            a *= a;
            a = a % mod;
            b = b >> 1;
        }
    }
    return result;
}

// read question properly
// don't forget newlines!!!!!!
// take care about cin >> t;
// comment the optimization before debugging
// DG CHUTIYA DOES DG CHUTIYA THINGS. SO DG, DON'T DO DG CHUTIYA THINGS!

void solve()
{
    ll l, r;
    cin >> l >> r;
    ll offset = 0, a, b, c;
    for (ll i = 30; i >= 0; i--)
    {
        // cout << l << " " << r << "\n";
        ll p = (1 << i);
        if (l >= p && r >= p)
        {
            offset += p;
            l -= p;
            r -= p;
        }
        else if (l < p && r >= p)
        {
            a = p, b = p - 1;
            c = l;
            if (c == b)
                c = a + 1;
            break;
        }
    }
    a += offset;
    b += offset;
    c += offset;
    cout << a << " " << b << " " << c << "\n";
}

int main()
{
#ifndef ONLINE_JUDGE
    clock_t T = clock();
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif

    // ios_base::sync_with_stdio(false);
    // cin.tie(NULL);
    // cout.tie(NULL);

    // seive_of_eratosthenes();

    long long t = 1;
    cin >> t;

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

#ifndef ONLINE_JUDGE
    cout << "\nTime taken: " << ((float)(clock() - T)) / CLOCKS_PER_SEC << " seconds";
#endif
    return 0;
}

Solution 2 (runtime: 62 ms):
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
void solve() {
	int l, r;
	scanf("%d%d", &l, &r);
	int a = 0, b = 0, c;
	for(int k = 29; k >= 0; k--) {
		int w = 1 << k;
		if((l & w) == (r & w)) {
			if(l & w) a += w, b += w;
		} else {
			a += w;
			b += w - 1;
			break;
		}
	}
	if(a == r) c = b - 1;
	else c = a + 1;
	printf("%d %d %d\n", a, b, c);
}
int main() {
	// freopen("1.in", "r", stdin);
	// freopen("1.out", "w", stdout);
    int T = 1;
	scanf("%d", &T);
	while(T--) solve();

    return 0;
}