Problem: 2057C - Trip to the Olympiad
Language: C++17 (GCC 7-32)

Previous submission (verdict: Wrong answer on test 1):
#include "bits/stdc++.h"
#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;

template<class K> using ordered_set =  tree<K, null_type, less<K>, rb_tree_tag, tree_order_statistics_node_update>;

template<typename T> using ordered_multiset = tree<pair<T, int>, null_type, less<pair<T, int>>, rb_tree_tag, tree_order_statistics_node_update>;
#define ll long long
#define uint unsigned int
#define pii pair <int , int>
#define pis pair <int, string>
#define mii map<int,int>
#define mmi map<int,map<int,int>>
#define mll map<long long, long long>
#define vi vector <int>
#define vll vector<long long>
#define vvi vector<vector<int>>
#define vvll vector<vector<long long>>
#define pb push_back
#define mp make_pair
#define all(x) x.begin(), x.end()
#define fi first
#define se second

#define forn(i, n) for (int i = 0; i < n; ++i)
#define foru(i, a, b) for (int i = a; i <= b; ++i)
#define ford(i, a, b) for (int i = a; i >= b; --i)
#define w(t) while(t--)

const int MOD = 1000000007;
const char nl = '\n';
const int MX = 1e9 +1;
const ll MXX =  1e18 + 1;
using namespace std;

void solve(){
    int m,M;
    cin>>m>>M;
    int x=1;
    while(x<=M)x<<=1;
    x>>=1;
    int ans=M;
    while(x){
        ans^=x;
        if(ans<m)ans^=x;
        x>>=1;
    }
    if(ans==m){
        cout<<M<<' '<<ans<<' '<<ans+1<<endl;
    }
    else{
        cout<<M<<' '<<ans<<' '<<m<<endl;
    }


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

    int T = 1;
    cin >> T;
    w(T) {
        solve();
    }

    return 0;
}

Submission (verdict: Wrong answer on test 2):
#include "bits/stdc++.h"
#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;

template<class K> using ordered_set =  tree<K, null_type, less<K>, rb_tree_tag, tree_order_statistics_node_update>;

template<typename T> using ordered_multiset = tree<pair<T, int>, null_type, less<pair<T, int>>, rb_tree_tag, tree_order_statistics_node_update>;
#define ll long long
#define uint unsigned int
#define pii pair <int , int>
#define pis pair <int, string>
#define mii map<int,int>
#define mmi map<int,map<int,int>>
#define mll map<long long, long long>
#define vi vector <int>
#define vll vector<long long>
#define vvi vector<vector<int>>
#define vvll vector<vector<long long>>
#define pb push_back
#define mp make_pair
#define all(x) x.begin(), x.end()
#define fi first
#define se second

#define forn(i, n) for (int i = 0; i < n; ++i)
#define foru(i, a, b) for (int i = a; i <= b; ++i)
#define ford(i, a, b) for (int i = a; i >= b; --i)
#define w(t) while(t--)

const int MOD = 1000000007;
const char nl = '\n';
const int MX = 1e9 +1;
const ll MXX =  1e18 + 1;
using namespace std;

void solve(){
    int m,M;
    cin>>m>>M;
    int x=1;
    while(x<=M)x<<=1;
    int ans=x-1;
    x>>=1;
    while(x){
        // ans+=x&(x^M);
        ans^=(x&M);
        if(ans<m||ans>M)ans^=x;
        x>>=1;
    }
    if(ans==m){
        cout<<M<<' '<<ans<<' '<<ans+1<<endl;
    }
    else{
        cout<<M<<' '<<ans<<' '<<m<<endl;
    }


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

    int T = 1;
    cin >> T;
    w(T) {
        solve();
    }

    return 0;
}