import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;
public class Main {
static class Course{
private String name;
private double credit;
private double score;
public Course(String name, double credit, double score) {
this.name = name;
this.credit = credit;
this.score = score;
}
}
public static void main(String[] args) throws IOException {
BufferedReader bufferedReader=new BufferedReader(new InputStreamReader(System.in));
int n=Integer.parseInt(bufferedReader.readLine());
outerLoop:
for (int i=0;i<n;i++){
int k=Integer.parseInt(bufferedReader.readLine());
ArrayList<Course>arrayList=new ArrayList<>();
for (int j=0;j<k;j++){
String []input=bufferedReader.readLine().split(" ");
String name=input[0];
double credit=Double.parseDouble(input[1]);
double score=Double.parseDouble(input[2]);
if (score<60){
System.out.println("Sorry!");
break outerLoop;
}
arrayList.add(new Course(name,credit,score));
}
double sum1=0;
double sum2=0;
for (int j=0;j<k;j++){
sum1+=arrayList.get(j).credit*arrayList.get(j).score;
sum2+=arrayList.get(j).credit;
}
System.out.println(String.format("%.2f",sum1/sum2));
}
}
}