#include <bits/stdc++.h>
using namespace std;

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

    int n, q;
    cin >> n >> q;
    int a[n+1];
    for (int i = 1; i <= n; i++)
    cin >> a[i];

    while (q--)
    {
        int t;
        cin >> t;
        if (t == 2)
        {
            int l, r;
            cin >> l >> r;

            if ((r-l+1)%2 == 0)
            cout << l << " " << r << endl;
            else
            cout << l << " " << r-1 << endl;
        }
    }
}
