#include <bits/stdc++.h>
int main(void) {
  int n, a, b, c;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d%d%d", &a, &b, &c);
    b += c;
    if (a * 2 == b) {
      printf("%d %d\n", a, a);
      continue;
    }
    if (a < b) {
      printf("%d %d\n", 1 + b - a, a);
    } else {
      printf("1 %d\n", b - 1);
    }
  }
}
