#include <cstdio>
#include <iomanip>
#include <iostream>

using namespace std;

typedef long double ld;

class Point {
public:
	ld x, y;
	Point(ld x, ld y) :
			x(x), y(y) {
	}
	Point operator +(Point p) {
		return Point(x + p.x, y + p.y);
	}
	Point operator -(Point p) {
		return Point(x - p.x, y - p.y);
	}
	Point operator *(ld a) {
		return Point(x * a, y * a);
	}
};

class Segment {
public:
	Point p1, p2;
	Segment(Point p1, Point p2) :
			p1(p1), p2(p2) {
	}
};

ld norm(Point p) {
	return p.x * p.x + p.y * p.y;
}

ld dot(Point p1, Point p2) {
	return p1.x * p2.x + p1.y * p2.y;
}

Point project(Segment s, Point p) {
	Point base = s.p2 - s.p1;
	ld r = dot(p - s.p1, base) / norm(base);
	return s.p1 + base * r;
}

Point reflect(Segment s, Point p) {
	return p + (project(s, p) - p) * 2.0;
}

int main() {

	int p1x, p1y, p2x, p2y;
	scanf("%d %d %d %d", &p1x, &p1y, &p2x, &p2y);
	Point p1(p1x, p1y);
	Point p2(p2x, p2y);
	Segment s(p1, p2);

	int q;
	scanf("%d", &q);

	for (int i = 0; i < q; ++i) {
		int qx, qy;
		scanf("%d %d", &qx, &qy);
		Point p(qx, qy);
		Point ans = reflect(s, p);
		cout << fixed << setprecision(10) << ans.x << " " << ans.y << endl;
	}

	return 0;
}