#include<bits/stdc++.h> using namespace std; // using P = pair<int, int>; const int M = 1000000007; using P = complex<long double>; int main() { long double xa, ya, ta, x11, y11, x12, y12, x21, y21, x22, y22; cin >> xa >> ya >> ta >> x11 >> y11 >> x12 >> y12 >> x21 >> y21 >> x22 >> y22; P a = P(xa, ya); P p11 = P(x11, y11); P p12 = P(x12, y12); P p21 = P(x21, y21); P p22 = P(x22, y22); P v = p12 - p11; P v1 = p21 - a; P v2 = p22 - a; long double d = abs(v); long double l1 = abs(v1); long double l2 = abs(v2); long double dar = arg(v2) - arg(v1); if (dar < 0) dar += M_PI * 2; long double ct = (d * d + l1 * l1 - l2 * l2) / (2 * d * l1); P p = dar < M_PI ? p11 + v * P(ct, sqrtl(1 - ct * ct)) / d * l1 : p11 + v / P(ct, sqrtl(1 - ct * ct)) / d * l1; long double t = ta - arg((p22 - p21) / v) / M_PI * 180; if (t < 0) t += 360; cout << setprecision(9); cout << p.real() << " " << p.imag() << " " << t << "\n"; return 0; }