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

Solution 1 (runtime: 62 ms):
#include <bits/stdc++.h>
using namespace std;
const char nl = '\n';
const char sp = ' ';
const int inf = 0x3f3f3f3f;
const string OUT[2]{ "NO", "YES" };
const string out[2]{ "No", "Yes" };
#define all(a) a.begin(), a.end()
#define dbg(a) cerr << (#a) << " = " << a << nl
#define OK() cerr << "OK until line " << __LINE__ << nl
using ll = long long;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
ifstream fin(".in");
ofstream fout(".out");

auto start_time = chrono::high_resolution_clock::now();

double amcbn() {
    auto end_time = chrono::high_resolution_clock::now();
    return chrono::duration<double>(end_time - start_time).count();
}

template<typename T>
int rand(T a, T b) { return uniform_int_distribution<T>(a, b)(rng); }

template<typename T1, typename T2>
bool ckmax(T1& a, T2 b) { return a < b ? a = b, true : false; }

template<typename T1, typename T2>
bool ckmin(T1& a, T2 b) { return a > b ? a = b, true : false; }


// Idee: a = b = x, c = y
void testcase() {
    long long l, r;
    cin >> l >> r;
    long long x = l, y = r;
    int mismatch = 31;
    while (!(((x ^ y) >> mismatch) & 1)) {
        --mismatch;
    }
    x = (((x >> mismatch) | 1) << mismatch) - 1;
    y = (y >> mismatch) << mismatch;
    if (x - 1 >= l) {
        cout << x - 1 << " " << x << " " << y << "\n";
    }
    else {
        cout << x << " " << y << " " << y + 1 << "\n";
    }
}

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    int tc = 1;
    cin >> tc;
    for (int t = 1; t <= tc; ++t) {
#ifdef _DEBUG
        cerr << "=== Subtask " << t << " ===" << nl;
#endif
        testcase();
#ifdef _DEBUG
        cerr << nl;
#endif
    }
}

Solution 2 (runtime: 61 ms):
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <stack>
#include <iomanip>
#include <cmath>
#include <cstring>
#include <numeric>
#include <cstdio>
#include <list>
#include <cassert>
#include <climits>
#include <bitset>
#include <functional>

using namespace std;

#define IN(type, name) \
  type name; \
  cin >> name;

#define For(var, constant, init) for (int var = init; var < constant; var++)

#define Sp << ' ' <<
#define End << '\n'

#define PI 3.141592653589793238462643383279502884L

#define ll long long
#define ull unsigned long long
#define uint unsigned int
#define ld long double

#define MOD 1000000007

typedef vector<int> vint;
typedef vector<ll> vll;
typedef pair<int, int> pint;
typedef pair<ll, ll> pll;

int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);

  /*
    For each i, We need to have one/two set bits among all three numbers. That way we can get
    2^i * 2 added to the sum. Is that possible in all cases?
  */
  IN(int, t);
  while(t--) {
    IN(int, l);
    IN(int, r);

    int x = (l ^ r);
    int a = 0, b = 0, c = 0;

    int bit = 31;
    while(bit >= 0) {
      if ((x & (1<<bit))) break;
      if ((l & (1<<bit))) {
        a |= (1<<bit);
        b |= (1<<bit);
      }
      bit--;
    }

    a |= (1<<bit);
    b |= ((1<<bit) - 1);

    for(int num = l; num <= r; num++) {
      if (num != a && num != b) {c = num; break;}
    }
    
    cout << a Sp b Sp c End;
  }

}