#include<iostream>
#include<cstdio>
#include<complex>
using namespace std;

typedef complex<double> Point;

Point project(Point a,Point b,Point c){
	c-=a; b-=a;
	double t=(c.real()*b.real()+c.imag()*b.imag())/abs(b);
	Point z=t/abs(b)*b+a;
	return z;
}

int main(){
	double x1,y1,x2,y2;
	cin>>x1>>y1>>x2>>y2;
	Point p1(x1,y1),p2(x2,y2);
	int z;
	cin>>z;
	while(z--){
		double q1,q2;
		cin>>q1>>q2;
		Point p(q1,q2);
		Point y=project( p1,p2,p);
		printf("%.10lf %.10lf\n",2*y.real()-p.real(),2*y.imag()-p.imag());
	} 
	return 0;
}
