There are $N$ ($ 1 \le N \le 10^5 $) points in the plane, represented by the pair $ (x_i, y_i) $ for the $i$-th point. Each point can be in only one of two states: active or inactive. Initially, all points are active. To these, a series of operations are applied, which are described below:
The active points are rotated by $ a $ degrees with respect to the origin $ (0,0) $, counterclockwise. The value of $ a $ will be integer and comply the following constraints: $ a \in \{0, 90, -90, 180, -180, 270, -270\}$.
All active points are translated: let $ (x_i, y_i) $ be an active point, then its new value becomes $ (x_i + t_x, y_i + t_y) $. The values of $ t_x $ and $ t_y $ will be integers and comply the following constraints: $ -5 \times 10^4 \le t_x , t_y \le 5 \times 10^4 $.
The following scaling operation is applied to all active points: let $(x_i, y_i) $ be an active point, then its new value becomes $(x*m_x, y*m_y) $. The values of $ m_x $ and $ m_y $ will be integers and comply the following constraints: $ -5 \times 10^4 \le m_x , m_y \le 5 \times 10^4 $.
The following scaling operation is applied to all active points: let $(x_i, y_i) $ be an active point, then its new value becomes $(x_i/d_x, y_i/d_y)$. It is ensured that $ x_i $ is divisible by $ d_x $ and that $ y_i $ is divisible by $ d_y $. The values of $ d_x $ and $ d_y $ will be integers and will fit the range $ -5 \times 10^4 \le d_x , d_y \le 5 \times 10^4 $.
The $i$-th point becomes inactive if it is active, and active if it is inactive. If a point is inactive, the operations described above have no effect on it.
The coordinates of the $i$-th point should be printed, regardless of its active status.