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

Solution 1 (runtime: 62 ms):
#include <bits/stdc++.h>
typedef long long ll;
typedef long double ld;
typedef std::vector<ll> vll;
typedef std::pair<ll, ll> pll;
typedef std::map<ll, ll> mll;
typedef std::tuple<ll, ll, ll> tll;

using namespace std;

void dbg_out() { cerr << endl; }
template<typename Head, typename... Tail>
void dbg_out(Head H, Tail... T) { cerr << ' ' << H; dbg_out(T...); }
#define dbg(...) cerr << "(" << #__VA_ARGS__ << "):", dbg_out(__VA_ARGS__)

//const int N = 2e5 + 20;
//const ll inf = 3e18 + 20;
//const ll MOD = 1e9 + 7;

ll l, r;

void do_thing() 
{
  ll diff = r ^ l;
  ll i = 0;
  ll sum = 0;
  while ((1 << i) <= diff)
  {
    sum += (1 << i);
    i++;
  }
  i--;
  ll ans = l | ((1 << i) - 1);
  cout << (ans == l? r : l) << " " << ans << " " << ans + 1 << endl;
}

int main() 
{
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ll th;
  cin >> th;
  while (th--) {
    cin >> l >> r;
    do_thing();
  }
  return 0;
}

Solution 2 (runtime: 77 ms):
// x.cpp

#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 MOD 1000000007
#define MOD1 998244353
#define INF 1000000000000000000LL
#define endl "\n"
#define nline cout << endl
#define pb push_back
#define ppb pop_back
#define m_p make_pair
#define ff first
#define ss second
#define bg begin
#define lbd lower_bound
#define ubd upper_bound
#define pll pair<ll, ll>
#define PI 3.141592653589793238462
#define set_bits(x) __builtin_popcountll(x)
#define sz(x) ((ll)(x).size())
#define all(x) (x).begin(), (x).end()
#define allR(x) (x).rbegin(), (x).rend()

using ll = long long;
using ull = unsigned long long;
using lld = long double;

//------------------------------Debug---------------------------------------------------------------------//

#ifndef ONLINE_JUDGE
#define dbg(x) cerr << #x <<" "; _print(x); cerr << endl;
#else
#define dbg(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(lld t) {cerr << t;}
void _print(double t) {cerr << t;}
void _print(ull t) {cerr << t;}

template <class T, class V> void _print(pair <T, V> p);
template <class T> void _print(vector <T> v);
template <class T> void _print(set <T> v);
template <class T, class V> void _print(map <T, V> v);
template <class T> void _print(multiset <T> v);
template <class T, class V> void _print(pair <T, V> p) {cerr << "{"; _print(p.ff); cerr << ","; _print(p.ss); cerr << "}";}
template <class T> void _print(vector <T> v) {cerr << "[ "; for (T i : v) {_print(i); cerr << " ";} cerr << "]";}
template <class T> void _print(set <T> v) {cerr << "[ "; for (T i : v) {_print(i); cerr << " ";} cerr << "]";}
template <class T> void _print(multiset <T> v) {cerr << "[ "; for (T i : v) {_print(i); cerr << " ";} cerr << "]";}
template <class T, class V> void _print(map <T, V> v) {cerr << "[ "; for (auto i : v) {_print(i); cerr << " ";} cerr << "]";}

// -------------------------------------------------------------------------------------------------------//

template <typename T> void read(T& t) { cin >> t; }
template <typename T, typename... Args> void read(T& t, Args&... args) { read(t); read(args...); }
template <typename T> void read(vector<T>& vec) { for (auto& element : vec) { cin >> element; } }
template <typename T> void print(const T& t) { cout << t << " "; }
template <typename T> void prints(const T& t) { cout << t; }
template <typename T, typename... Args> void print(const T& t, const Args&... args) { print(t); print(args...); }
template <typename T, typename... Args> void prints(const T& t, const Args&... args) { prints(t); print(args...); }
template <typename T> void print(const vector<T>& vec) { for (const auto& element : vec) { cout << element << " "; } cout << "\n"; }
template<class T> using oset = tree<T, null_type, less_equal<T>, rb_tree_tag, tree_order_statistics_node_update>;

// -------------------------------------------------------------------------------------------------------//

ll gcd (ll a, ll b) {  return b ? gcd (b, a % b) : a;  }
ll lcm (ll a, ll b) {  return (a * b) / gcd(a, b); }

//--------------------------------------------------------------------------------------------------------//

void solve() {
	ll l, r;
	read(l, r);

	bitset<32> ar(l), br(r);

	// for (ll i = 31; i >= 0; i--) {
	// 	prints(ar[i]);
	// }
	// nline;
	// for (ll i = 31; i >= 0; i--) {
	// 	prints(br[i]);
	// }
	// nline;

	ll extra = 0;
	ll a = -1, b = 0, c, bit = -1;
	for (ll i = 31; i >= 0; i--) {
		if (ar[i] != br[i]) {
			a = (1LL << i) + extra;
			bit = i - 1;
			break;
		}
		else
			extra += (ar[i] * (1LL << i));
	}
	b = extra;
	for (ll i = bit; i >= 0; i--)
		b += (1LL << i);

	for (ll i = l; i <= r; i++)
		if (i != a and i != b) {
			c = i;
			break;
		}
	print(a, b, c); nline;
}

int main() {
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
	freopen("error.txt", "w", stderr);
#endif
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	ll tc;
	tc = 1;
	read(tc);
	for (ll i = 1; i <= tc; i++) {
		solve();
	}

	return 0;
}