#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const long long linf = (1ll << 62) - 1;
const int N = 3e5 + 7;
const int M = 2e6 + 7;
const int mod = 1e9 + 7;
template <typename T>
inline void rd(T &x) {
  char c;
  int sign = 1;
  x = 0;
  do {
    c = getchar();
    if (c == '-') sign = -1;
  } while (c < '0' || c > '9');
  do {
    x = x * 10 + c - '0';
    c = getchar();
  } while (c >= '0' && c <= '9');
  x *= sign;
}
int main() {
  int n, x, y, t;
  scanf("%d", &t);
  while (t--) {
    scanf("%d%d%d", &n, &x, &y);
    int a = x + y <= n ? 1 : min(n, x + y - n + 1);
    int b = x + y <= n ? x + y - 1 : n;
    printf("%d %d\n", a, b);
  }
  return 0;
}
