Problem: 2057C - Trip to the Olympiad
Language: C++20 (GCC 13-64)

Previous submission (verdict: Wrong answer on test 1):
#include<iostream>
#include<set>
#include<map>
#include<string>
#include<algorithm>
#include<iomanip>
#include<vector>
#include<cstring>
#include<stack>
#include<queue>
#define	pb push_back
#define snd second
#define fst first
#define forn(i,n) for(int i=0;i<n;++i)
#define forsn(i,s,n) for(int i=s; i<n; ++i)
#define SZ(c) int((c).size())
#define all(x) x.begin(), x.end()
#define	imp(x) {for(auto __:x)cout<<__<<" "; cout<<endl;}
#define DBG(x) cerr << #x << " = " << (x) << endl
#define RAYA cerr << "===============================" << endl
using namespace std;
typedef long long ll;
typedef pair<ll,ll> ii;
typedef vector<ll> vi;
int main(){	
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr); 
	int tt;cin>>tt;
	while(tt--){
		int l,r;cin>>l>>r;
		int	topBit=30;
		while((l&(1<<topBit))==(r&(1<<topBit))){
			topBit--;
		}
		int c;
		forsn(i,l,r+1){
			if(i!=(1<<topBit)&&i!=(1<<topBit)-1){c=i;break;}
		}
		cout<<(1<<topBit)<<" "<<(1<<topBit)-1<<" "<<c<<endl;
	}
}

//La respuesta en algunos casos parece ser la suma de 2*(1+2+...,+2^topBit);
//La respuesta es simplemente topBit, topBit-1 y un numero cualquiera
//Teniendo en cuenta que simplemente si aparece en dos o menos siempre agrega
//a nuestra respuesta


Submission (verdict: Wrong answer on test 1):
//**Template_begin**//
#include<bits/stdc++.h>

#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;

typedef tree<long long, null_type, less<long long>, rb_tree_tag, tree_order_statistics_node_update> pbds; // find_by_order, order_of_key
 
#define ll long long
#define int long long
#define ld long double
#define inf 1000000000000000005
#define mod 1000000007
typedef pair<int, int> pii;
typedef vector<int> vii;
typedef vector<ll> vll;
typedef pair<ll, ll> pll;
#define pb push_back
#define ppb pop_back
#define puf push_front
#define pof pop_front
#define lb lower_bound
#define ub upper_bound
#define fi first
#define se second
#define sz(x) (ll)x.size()
#define HAR_HAR_MAHADEV ios_base::sync_with_stdio(false);cin.tie(NULL);
const int N = 1e6 + 10;
 
// std::cout << std::fixed;
// std::cout << std::setprecision(12);
// floor(2.3)
// ceil(2.3)

struct custom_hash {
    static uint64_t splitmix64(uint64_t x) {
        // http://xorshift.di.unimi.it/splitmix64.c
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }
 
    size_t operator()(uint64_t x) const {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
}; // unordered_map<ll , ll , custom_hash> mp;
 
//******//
//**Template_end***//

ll expo(ll a, ll b, ll mod1) {ll res = 1; while (b > 0) {if (b & 1ll)res = (res * a) % mod1; a = (a * a) % mod1; b = b >> 1ll;} return res;}

void solve(){
    int l , r; cin >> l >> r;
    int a = 0 , b = 0 , c = 0;
    
    for(int i = 0; i < 31; ++i) {
        if((r & ((int)1 << i)) and (l & ((int)1 << i))) {
            a |= (r & ((int)1 << i));
            b |= (r & ((int)1 << i));
            c |= (r & ((int)1 << i));
        } else {
            if(i >= 2){
                a |= (r & ((int)1 << i));
                
                if((l & ((int)1 << (i + 1)))) {
                    b = a - 1;
                    
                    if(a + 1 >= l and a + 1 <= r) {
                        cout << a << " " << b << " " << a + 1 << "\n";
                    } else {
                        cout << a << " " << b << " " << b - 1 << "\n";
                    }
                } else {
                    int p = ((int)1 << (i - 1));
                    b += p;
                    --p;
                    c += p;                    
                    
                    cout << a << " " << b << c << "\n";
                }
            } else {
                if(r - l + 1 == 3) { 
                   cout << r << " " << r - 1 << " " << r - 2 << "\n";
                } else {
                    vector<int> v = { r , r - 1 , r - 2 , r - 3};
                    int ans = -1;
                    
                    vector<int> fans;
                    
                    for(int mask = 0; mask < ((int)1 << 4); ++mask) {
                        int cnt = __builtin_popcountll(mask);
                        
                        if(cnt == (int)3) {
                            int currAns = 0;
                            
                            vector<int> _fans;
                            
                            for(int j = 0; j < 4; ++j) {
                                if(mask & ((int)1 << j)) {
                                    currAns ^= v[j];
                                    _fans.pb(v[j]);
                                }
                            }
                            
                            if(currAns > ans) {
                                swap(_fans , fans);
                            }
                            
                            ans = max(ans , currAns);
                        }
                    }
                    
                    cout << fans[0] << " " << fans[1] << " " << fans[2] << "\n";
                }
            }
            
            break;
        }
    }
    
    // 10111011110
    // 1001
}  
 
int32_t main(){
 
    HAR_HAR_MAHADEV
 
    ll t = 1;
    cin >> t;
 
    while(t--){
        solve();
    } 


 /*
   Think of the edge case (n == 1 ?).
   Don't get stuck on a single approach for a long time.
   Also don't get stuck on a single problem for a long time :).
 */   
 
    return 0;
}

/*

*/