Problem: For given three points p1, p2, p, find the reflection point x of p onto p1p2.

<image>

Constraints

* 1 ≤ q ≤ 1000
* -10000 ≤ xi, yi ≤ 10000
* p1 and p2 are not identical.

Input


xp1 yp1 xp2 yp2
q
xp0 yp0
xp1 yp1
...
xpq−1 ypq−1


In the first line, integer coordinates of p1 and p2 are given. Then, q queries are given for integer coordinates of p.

Output

For each query, print the coordinate of the reflection point x. The output values should be in a decimal fraction with an error less than 0.00000001.

Examples

Input

0 0 2 0
3
-1 1
0 1
1 1


Output

-1.0000000000 -1.0000000000
0.0000000000 -1.0000000000
1.0000000000 -1.0000000000


Input

0 0 3 4
3
2 5
1 4
0 3


Output

4.2400000000 3.3200000000
3.5600000000 2.0800000000
2.8800000000 0.8400000000

Solution (in CPP):

Solution:
#pragma GCC optimize("Ofast", "unroll-loops")

#include <bits/stdc++.h>

using namespace std;

#define ld long double

/* 幾何ライブラリ */
// 2次元座標, 2次元ベクトル
using pos = pair<ld, ld>;

// 加算
pos add(pos p1, pos p2) {
	return { p1.first + p2.first, p1.second + p2.second };
}
// 減算
pos sub(pos p1, pos p2) {
	return { p1.first - p2.first, p1.second - p2.second };
}
// 内積
ld inner_product(pos p1, pos p2) {
	return p1.first * p2.first + p1.second * p2.second;
}
// 定数倍
pos mul(ld c, pos p) {
	return { c * p.first, c * p.second };
}

// ノルムの2乗
ld norm2(pos p) {
	return p.first * p.first + p.second * p.second;
}
// ノルム
ld norm(pos p) {
	return sqrt(norm2(p));
}

// 射影
// pをp1, p2を通る直線に射影する
// 検証済み(https://onlinejudge.u-aizu.ac.jp/courses/library/4/CGL/all/CGL_1_A)
pos projection(pos p1, pos p2, pos p) {
	pos q = sub(p2, p1);
	pos tmp = mul(inner_product(q, sub(p, p1)) / norm2(q), q);
	return add(p1, tmp);
}

// 反射
// pをp1, p2を通る直線に関して対称移動する
pos reflection(pos p1, pos p2, pos p) {
	pos tmp = projection(p1, p2, p);
	return add(p, mul(2.0, sub(tmp, p)));
}

int main() {
	cout << setprecision(15);
	pos p1, p2;
	cin >> p1.first >> p1.second >> p2.first >> p2.second;
	int q; cin >> q;
	while (q--) {
		pos p; cin >> p.first >> p.second;
		pos res = reflection(p1, p2, p);
		cout << res.first << " " << res.second << endl;
	}
	return 0;
}