import java.util.Scanner;/**
* @Auther: jahup
* @blog: https://blog.youkuaiyun.com/jahup
*/publicclassMain{static way v[]=newway[200010];staticint n;publicstaticvoidmain(String[] args){int t;
Scanner sc =newScanner(System.in);
t = sc.nextInt();while(t-->0){
n = sc.nextInt();int a, b, c;int l =0, r =0;for(int i =1; i <= n; i++){
a = sc.nextInt();
b = sc.nextInt();
c = sc.nextInt();
v[i]=newway(a, b, c);
r = Math.max(r, b);}while(l < r){int mid = l + r >>1;if((getall(mid)&1)>0) r = mid;else l = mid +1;}long sum=getall(l)-getall(l-1);if((sum%2)>0)
System.out.println(l+" "+sum);else
System.out.println("There's no weakness.");}}staticlonggetall(int x){long res =0;for(int i =1; i <= n; i++){if(v[i].s <=x)
res +=(Math.min(v[i].e, x)- v[i].s)/ v[i].d+1;}return res;}}classway{int s, e, d;publicway(int s,int e,int d){this.s = s;this.e = e;this.d = d;}}