시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 1024 MB42141238.710%

문제

A simple motion over and over...


t.A.T.u., <<A Simple Motion>>

Julia loves simple motions very much especially in three-dimensional space! Recently she found a matrix that corresponds with some rotation around an axis that goes through the origin. Rotation is defined by unit vector $v = \begin{pmatrix} v_x \\ v_y \\ v_z \end{pmatrix}$ and rotation angle $\alpha$.

Suppose you look at the origin from the end of $v$ then if rotation is going counter-clockwise then $\alpha$ will be positive, negative overwise.

Rotation matrix moves point $\begin{pmatrix} x \\ y \\ z \end{pmatrix}$ to $\begin{pmatrix} x' \\ y' \\ z' \end{pmatrix}$ like this: $$ \begin{pmatrix} x' \\ y' \\ z' \end{pmatrix} = \begin{pmatrix} A_{11} & A_{12} & A_{13} \\ A_{21} & A_{22} & A_{23} \\ A_{31} & A_{32} & A_{33} \\ \end{pmatrix} \times \begin{pmatrix} x \\ y \\ z \end{pmatrix}. $$

Unfortunately Julia doesn't know values of $v$ and $\alpha$, so she asked you to restore them and then she will continue her simple motion.

입력

You are given matrix $A$. It is guaranteed that there is such rotation matrix $A'$ that $|A'_{ij} - A_{ij}| < 10^{-13}$.

출력

First line should contain $\alpha$ in degrees. Second line should contain coordinates of unit vector $v$. It is guaranteed that $1 \le |\alpha| \le 179$. Output all number as precise as you can. Your answer will be considered correct if the difference between $A_{ij}$ and the matrix constructed from your angle and unit vector will not exceed $10^{-6}$.

예제 입력 1

0 -1 0
1 0 0
0 0 1

예제 출력 1

90
0 0 1