#include <bits/stdc++.h>
int t, n, x, y, a1, a2;
int main() {
  scanf(" %d", &t);
  while (t--) {
    scanf(" %d %d %d", &n, &x, &y);
    a1 = (x + y > n) ? ((x + y - n + 1 > n) ? n : x + y - n + 1) : 1;
    a2 = (x + y < n + 2) ? x + y - 1 : n;
    printf("%d %d\n", a1, a2);
  }
  return 0;
}
