from math import atan2, degrees def solve(): input() for _ in range(6): x, y = map(float, input().split()) tmp = degrees(atan2(y, x)) if -1 <= tmp <= 51: ans = tmp print(ans) for _ in range(int(input())): solve()