#include <bits/stdc++.h>
using namespace std;


typedef struct point_{
	double x,y;
	struct point_ operator-(const struct point_ & r) const{
		return {x-r.x,y-r.y};
	}
	struct point_ operator+(const struct point_ & r) const{
		return {x+r.x,y+r.y};
	}
	double norm2(){
		return x*x+y*y;
	}
} Point;

double dot(Point p1,Point p2) {
	return p1.x * p2.x + p1.y * p2.y;
}
Point c_mul(double c,Point p){
	return {c*p.x,c*p.y};
}

int main(){
	Point p1,p2,p;
	int q;
	scanf("%lf%lf%lf%lf%d",&p1.x,&p1.y,&p2.x,&p2.y,&q);
	for(int i = 0; i < q; i++){
		scanf("%lf%lf",&p.x,&p.y);
		Point v = p - p1;
		Point u = p2 - p1;
		Point p1h = c_mul(dot(u,v)/u.norm2(),u);
		Point p1q = c_mul(2,p1h) - v;
		Point ans = p1 + p1q;
		printf("%.10f %.10f\n",ans.x,ans.y);
	}
	return 0;
}

