#include<iostream>
#include<vector>
#include<complex>
#include<cstdio>

using namespace std;

#define X real()
#define Y imag()

int main(){
	typedef complex<double> P;
	
	
	int a,b,c,d;
	cin>>a>>b>>c>>d;
	
	P padding = P(a,b);
	P p1 = P(0,0);
	P p2 = P(c-a, d-b);
	
	P e = p2 / abs(p2);
	
	int n;
	cin>>n;
	
	for(int i=0;i<n;i++){
		int g,h;
		cin>>g>>h;
		
		P q = P(g,h) - padding;
		
		double len = q.X*e.X + q.Y*e.Y;
		P pro = e*len;
		P ans = pro + (pro-q) + padding;
		
		printf("%.10lf %.10lf\n",ans.X, ans.Y);
		
	}
	
}