#include<cstdio>
#include<vector>
#include<algorithm>
#include<utility>
#include<numeric>
#include<iostream>
#include<array>
#include<string>
#include<sstream>
#include<stack>
#include<queue>
#include<list>
#include<functional>
#define _USE_MATH_DEFINES

#include<math.h>
#include<map>

#define INF 200000000

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<ll, int> pli;

int main()
{
	cin.tie(0);
	ios::sync_with_stdio(false);

	double x1, x2, y1, y2, x3, y3;
	cin >> x1 >> y1 >> x2 >> y2;

	x3 = (x2 - x1) / sqrt((x2 - x1)*(x2 - x1) + (y2 - y1)*(y2 - y1));
	y3 = (y2 - y1) / sqrt((x2 - x1)*(x2 - x1) + (y2 - y1)*(y2 - y1));

	int q;
	cin >> q;

	for (int i = 0; i < q; i++)
	{
		double px, py, px2, py2;
		cin >> px >> py;

		px2 = (px - x1);
		py2 = (py - y1);

		printf("%.10lf %.10lf\n", px + (x3*(px2*x3 + py2*y3) - px2) * 2, py + (y3*(px2*x3 + py2*y3) - py2) * 2);
	}

	return 0;
}
