import java.util.Scanner;

class solution {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int T = sc.nextInt();
		for (int t = 0; t < T; ++t) {
			int A = sc.nextInt();
			int B = sc.nextInt();
			int C = sc.nextInt();
			int D = ((9000 - 15*A - 20*B - 25*C)+39)/40;
			if (D < 0) System.err.println("WHAT?"); // should never happen
			if (D > 100) System.out.println("impossible");
			else System.out.println(D);
		}
	}
}
