#include <iostream>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>	// require sort next_permutation count __gcd reverse etc.
#include <cstdlib>	// require abs exit atof atoi 
#include <cstdio>		// require scanf printf
#include <functional>
#include <numeric>	// require accumulate
#include <cmath>		// require fabs
#include <climits>
#include <limits>
#include <cfloat>
#include <iomanip>	// require setw
#include <sstream>	// require stringstream 
#include <cstring>	// require memset
#include <cctype>		// require tolower, toupper
#include <fstream>	// require freopen
#include <ctime>		// require srand
#define rep(i,n) for(int i=0;i<(n);i++)
#define ALL(A) A.begin(), A.end()
#define EPS (1e-10)

using namespace std;

typedef long long ll;
typedef pair<int, int> P;

template<class T>
struct point{
	T x, y;
	point &operator+=(const point &a ){ x += a.x; y += a.y; }
	point &operator-=(const point &a ){ x -= a.x; y -= a.y; }
	point operator+(const point &a )const{ return (point){x+a.x, y+a.y }; }
	point operator-(const point &a )const{ return (point){x-a.x, y-a.y }; }
	operator point<double>()const{ return (point<double>){x, y }; }
};

template<class T>
point<T> operator*(T c, const point<T> &a ){ return (point<T>){c*a.x, c*a.y }; }
point<double> &operator/=(point<double> &a, double c ){ a.x /= c; a.y /= c; return a; }
template<class T>
point<double> operator/(const point<T> &a, double c ){ return (point<double>){ a.x/c, a.y/c }; }

template<class T>
struct line{
	point<T> a, b;
	operator line<double>()const{ return (line<double>){a, b}; }
};


//  for real number
bool operator<(const point<double> &a, const point<double> &b ){
	return (a.x + EPS < b.x || (abs (a.x - b.x ) < EPS && (a.y + EPS < b.y ) ) );
}

bool operator==(const point<double> &a, const point<double> &b ){
	return abs (a.x - b.x) < EPS && abs (a.y - b.y ) < EPS;
}

bool operator!=(const point<double> &a, const point<double> &b ){
	return abs (a.x - b.x ) > EPS || abs (a.y - b.y ) > EPS;
}

// inner product
template<class T>
T dot(const point<T> &a, const point<T> &b ){ return a.x*b.x + a.y*b.y; }

// outer product
template<class T>
T cross(const point<T> &a, const point<T> &b ){ return a.x*b.y - a.y*b.x; }


template<class T>
T abs2(const point<T> &a ){ return a.x*a.x + a.y*a.y; }

// 点 p を直線 L 上に射影した点を求める
// 	Verified: AOJ 0081 A Symmetric Point
template<class T>
point<double> proj(const point<T> &p, const line<T> &L ){
	return L.a + dot (p-L.a, L.b-L.a )/abs2 (L.b - L.a )*(L.b - L.a );
}

/*
	点対称

	説明
		点 b を基準に点 a を点対称を求める
	引数
		a : 点
		b : 点
	戻り値
		点対称の点
	計算量
		O(1)
	備考

*/
template<class T>
point<T> symmetry_point (const point<T> a, const point<T> b )
{
	return (point<T>){2*b.x-a.x, 2*b.y-a.y};
}

// 点 p を直線 L に対して対称となる点を求める
template<class T>
point<double> reflection(const point<T> &p, const line<T> &L ){
	point<double> h = proj (p, L );
	point<double> res = symmetry_point (p, h );

	return res;
}

int main()
{
	ios_base::sync_with_stdio(0);
	double xp0, yp0, xp1, yp1; cin >> xp0 >> yp0 >> xp1 >> yp1;
	line<double> L;
	L.a.x = xp0, L.a.y = yp0;
	L.b.x = xp1, L.b.y = yp1;

	int q; cin >> q;
	rep (i, q ){
		double xp2, yp2; cin >> xp2 >> yp2;
		point<double> p2; p2.x = xp2; p2.y = yp2;
		point<double> res = reflection (p2, L );
		printf ("%.9lf %.9lf\n", res.x, res.y );
	} // end rep
		
	return 0;
}

Measured memory_bytes: 1276