# Programmed by Mike Noseworthy and Andrew Horsman
# 11/25/2009
# Dwite Round 2 - Problem 1
# Angles

import math

bufferX = ""

getData = open("DATA1.txt", "r") # Get the DATA1.txt file.

inputs = []

for line in getData:
	
	if (line.strip != ""):
		inputs.append(line)
		
	
for i in inputs:

	i = i.split(" ")

	# Run each line in data file.
	
	# 77 77 100 0
	# x1 y1 x2 y2
	
	x1 = int(i[0])
	y1 = int(i[1])
	x2 = int(i[2])
	y2 = int(i[3])
	
	point1 = 0
	point2 = 0

	if x1 > 0  and y1 >= 0:
		point1 = 1
		
	if x2 > 0 and y2 >= 0:
		point2 = 1
	
	if x1 <= 0 and y1 > 0:
		point1 = 2
		
	if x2 <= 0 and y2 > 0:
		point2 = 2
		
	if x1 < 0 and y1 <= 0:
		point1 = 3
		
	if x2 < 0 and y2 <= 0:
		point2 = 3
		
	if x1 >= 0 and y1 < 0:
		point1 = 4
		
	if x2 >= 0 and y2 < 0:
		point2 = 4
	
	a = math.sqrt(pow(0 - x1, 2) + pow(0 - y1, 2))
	
	b = math.sqrt(pow(0 - x2, 2) + pow(0 - y2, 2))
	
	c = math.sqrt(pow(x1 - x2, 2) + pow(y1 - y2, 2))
	
	angle = math.degrees(math.acos((pow(c, 2) - pow(b, 2) - pow(a, 2)) / (-2 * b * a)))
	finalAngle = 0
	
	if point1 < point2:
		finalAngle = (360 - angle)
	elif point1 > point2:
		finalAngle = angle
	elif point1 == point2:
		if y2 > y1:
			finalAngle = (360 - angle)
		else:
			finalAngle = angle
		
	finalAngle = round(finalAngle, 1)
	bufferX += str(finalAngle) + "\n"
	
fileopen = open("OUT1.txt", "w")
fileopen.write(bufferX)


