#ifndef ___Class_Point
#define ___Class_Point

class Point
{
private:

	double x_;
	double y_;

public:

	Point() : x_(0), y_(0) { }

	explicit Point(double x, double y) : x_(x), y_(y) { }

	explicit Point(double x1, double y1, double x2, double y2) : x_(x2 - x1), y_(y2 - y1) { }

	double x() const { return x_; }
	double y() const { return y_; }

	Point& operator+= (const Point& p) { x_ += p.x_; y_ += p.y_; return *this; }
	Point& operator-= (const Point& p) { x_ -= p.x_; y_ -= p.y_; return *this; }

	Point& operator*= (double s) { x_ *= s; y_ *= s; return *this; }
	Point& operator/= (double s) { x_ /= s; y_ /= s; return *this; }

	friend bool operator== (const Point& p1, const Point& p2) { return p1.x_ == p2.x_ && p1.y_ == p2.y_; }
	friend bool operator!= (const Point& p1, const Point& p2) { return !(p1 == p2); }

	friend Point operator+ (const Point& p1, const Point& p2) { return Point(p1.x_ + p2.x_, p1.y_ + p2.y_); }
	friend Point operator- (const Point& p1, const Point& p2) { return Point(p1.x_ - p2.x_, p1.y_ - p2.y_); }

	friend Point operator* (const Point& p, double s) { return Point(p.x_ * s, p.y_ * s); }
	friend Point operator/ (const Point& p, double s) { return Point(p.x_ / s, p.y_ / s); }

	friend Point operator* (double s, const Point& p) { return Point(p.x_ * s, p.y_ * s); }
};

#endif

#ifndef ___Class_Vector
#define ___Class_Vector

#include <cmath>

typedef Point Vector;

double norm(Vector p1)
{
	return p1.x() * p1.x() + p1.y() * p1.y();
}

double abs(Vector p1)
{
	return sqrt(norm(p1));
}

double angle(Vector p1)
{
	return atan2(p1.y(), p1.x());
}

double angle(Vector p1, Vector p2)
{
	return angle(p2) - angle(p1);
}

double cross(Vector p1, Vector p2)
{
	return p1.x() * p2.y() - p1.y() * p2.x();
}

double dot(Vector p1, Vector p2)
{
	return p1.x() * p2.x() + p1.y() * p2.y();
}

#endif

#ifndef ___Class_Segment
#define ___Class_Segment

#include <utility>

typedef std::pair<Point, Point> Segment;

double len_sqr(Segment s)
{
	return pow(s.second.x() - s.first.x(), 2) + pow(s.second.y() - s.first.y(), 2);
}

double length(Segment s)
{
	return sqrt(len_sqr(s));
}

#endif

#ifndef ___Computational_Geometry
#define ___Computational_Geometry

bool palarell(Vector p1, Vector p2)
{
	return cross(p1, p2) == 0;
}

bool palarell(Point p1_s, Point p1_e, Point p2_s, Point p2_e)
{
	return palarell(p1_e - p1_s, p2_e - p2_s);
}

bool orthogonal(Vector p1, Vector p2)
{
	return dot(p1, p2) == 0;
}

bool orthogonal(Point p1_s, Point p1_e, Point p2_s, Point p2_e)
{
	return orthogonal(p1_e - p1_s, p2_e - p2_s);
}

double dist_sqr(Point p1, Point p2)
{
	return pow(p2.x() - p1.x(), 2) + pow(p2.y() - p1.y(), 2);
}

double distance(Point p1, Point p2)
{
	return sqrt(dist_sqr(p1, p2));
}

Vector projection(Vector hypo, Vector base)
{
	return base * (dot(hypo, base) / norm(base));
}

Point projection(Segment base, Point p)
{
	Vector v1(base.first.x(), base.first.y(), p.x(), p.y());
	Vector v2(base.first.x(), base.first.y(), base.second.x(), base.second.y());

	return base.first + projection(v1, v2);
}

#include <iostream>

using namespace std;

Point reflection(Segment base, Point p)
{
	return p + (projection(base, p) - p) * 2.0;
}

#endif

#include <cstdio>
#include <utility>

#pragma warning(disable: 4996)

int x2, y2, x3, y3, x4, y4, q;

int main()
{
	scanf("%d", &x2);
	scanf("%d", &y2);
	scanf("%d", &x3);
	scanf("%d", &y3);

	Segment s1 = std::make_pair(Point(x2, y2), Point(x3, y3));

	scanf("%d", &q);

	for (int i = 0; i < q; i++)
	{
		scanf("%d", &x4);
		scanf("%d", &y4);

		Point p1(x4, y4);

		Point p2 = reflection(s1, p1);

		printf("%.15f %.15f\n", p2.x(), p2.y());
	}

	return 0;
}

Measured memory_bytes: 3228