#include<bits/stdc++.h>
#define rep(i, n) for(int i=0;i<(n);++i)
#define per(i, n) for(int i=(n)-1;i>=0;--i)
#define repa(i, n) for(int i=1;i<(n);++i)
#define foreach(i, n) for(auto &i:(n))
#define pii pair<int, int>
#define pll pair<long long, long long>
#define all(x) (x).begin(), (x).end()
#define bit(x) (1ll << (x))
using namespace std;
using ll = long long;
const ll MOD = (ll)1e9+7;
//const ll MOD = 998244353;
//const ll MOD = 924844033;
const int INF = (ll)1e9+7;
const ll INFLL = (ll)1e18;
using namespace std;
template<class t>
using vvector = vector<vector<t>>;
template<class t>
using vvvector = vector<vector<vector<t>>>;
template<class t>
using priority_queuer = priority_queue<t, vector<t>, greater<t>>;
template<class t, class u> bool chmax(t &a, u b){if(a<b){a=b;return true;}return false;}
template<class t, class u> bool chmin(t &a, u b){if(a>b){a=b;return true;}return false;}

#ifdef DEBUG
#define OUTPUT(x) (output(x), outendl())
#else
#define OUTPUT(x) (void)0
#endif

ll modpow(ll x, ll b){
	ll res = 1;
	while(b){
		if(b&1)res = res * x % MOD;
		x = x * x % MOD;
		b>>=1;
	}
	return res;
}

ll modinv(ll x){
	return modpow(x, MOD-2);
}

bool was_output = false;
template<class t>
void output(t a){
	if(was_output)cout << " ";
	cout << a;
	was_output = true;
}
void outendl(){
	was_output = false;
	cout << endl;
}

//below here

template<class t>
class Vector2{
	public:
		t x;
		t y;
		Vector2():x(0), y(0){}
		Vector2(t a, t b):x(a), y(b){}
		Vector2(const Vector2 &o):x(o.x), y(o.y){}

		Vector2& operator+=(Vector2 o){x+=o.x;y+=o.y;return *this;}
		Vector2& operator-=(Vector2 o){x-=o.x;y-=o.y;return *this; }
		Vector2& operator*=(t o){x*=o;y*=o;return *this;}
		Vector2& operator/=(t o){x/=o;y/=o;return *this;}

		Vector2 operator+(Vector2 o){return Vector2(*this)+=o;}
		Vector2 operator-(Vector2 o){return Vector2(*this)-=o;}
		Vector2 operator*(t o){return Vector2(*this)*=o;}
		Vector2 operator/(t o){return Vector2(*this)/=o;}

		double abs(){
			return sqrt(x*x+y*y);
		}

		Vector2 normal(){
			return (*this) / abs();
		}
};

template<class t>
double abs(Vector2<t> x){
	return x.abs();
}

template<class t>
double dot(Vector2<t> x, Vector2<t> y){
	return x.x * y.x + x.y * y.y;
}

template<class t>
double cross(Vector2<t> x, Vector2<t> y){
	return x.x * y.y - x.y * y.x;
}

template<class t>
void output(Vector2<t> x){
	printf("%lf %lf\n", x.x, x.y);
}


template<class t>
class straight_line{
	public:
		using position = Vector2<t>;
		position f;
		position s;
		straight_line(){
			f = position(0,0);
			s = position(1,0);
		}
		straight_line(position a,position b){
			f = a;
			s = b;
		}

		position projection(position pos){
			pos -= f;
			position n = (s-f).normal();
			position res;
			res = n * dot(pos,n) + f;
			return res;
		}

		position reflection(position pos){
			position n;
			position res;
			pos -= f;
			t x = f.y-s.y;
			t y = s.x-f.x;
			n = position(x,y).normal();
			res = pos + f - n * dot(pos,n) * 2;
			return res;
		}
};

int main(){
	straight_line<double> line;
	{
		Vector2<double> first;
		Vector2<double> second;
		cin >> first.x >> first.y >> second.x >> second.y;
		line = straight_line<double>(first,second);
	}
	int q;
	cin >> q;
	rep(i,q){
		double x,y;
		cin >> x >> y;
		Vector2<double> ans = line.reflection(Vector2<double>(x,y));
		printf("%.10lf %.10lf\n",ans.x,ans.y);
	}
	return 0;
}



Measured memory_bytes: 3292