#!/usr/bin/ python3.8 import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines from math import sin, cos, atan2, pi xa, ya, ta = map(float, readline().split()) za = complex(xa, ya) z1 = complex(*map(float, readline().split())) z2 = complex(*map(float, readline().split())) z21 = complex(*map(float, readline().split())) z22 = complex(*map(float, readline().split())) ta = ta * pi / 180 def world_to_ship(z, za, ta): return (z - za) / complex(cos(ta), sin(ta)) """ def ship_to_world(w, za, ta): return w * complex(cos(ta), sin(ta)) + za """ w1 = world_to_ship(z21, za, ta) w2 = world_to_ship(z22, za, ta) rotate = (z2 - z1) / (w2 - w1) tb = atan2(rotate.imag, rotate.real) zb = z1 - w1 * rotate xb = zb.real yb = zb.imag tb = tb * 180 / pi print(xb, yb, tb)