#include <bits/stdc++.h>
using namespace std;
int main() {
  int T;
  cin >> T;
  while (T--) {
    int a, b, c;
    cin >> a >> b >> c;
    if (b + c <= a) {
      cout << 1 << endl;
    } else {
      cout << min(a, b + c - a + 1) << endl;
    }
    cout << min(a, b + c - 1) << endl;
  }
}
