For given three points p1, p2, p, find the reflection point x of p onto p1p2.

<image>

Constraints

* 1 ≤ q ≤ 1000
* -10000 ≤ xi, yi ≤ 10000
* p1 and p2 are not identical.

Input


xp1 yp1 xp2 yp2
q
xp0 yp0
xp1 yp1
...
xpq−1 ypq−1


In the first line, integer coordinates of p1 and p2 are given. Then, q queries are given for integer coordinates of p.

Output

For each query, print the coordinate of the reflection point x. The output values should be in a decimal fraction with an error less than 0.00000001.

Examples

Input

0 0 2 0
3
-1 1
0 1
1 1


Output

-1.0000000000 -1.0000000000
0.0000000000 -1.0000000000
1.0000000000 -1.0000000000


Input

0 0 3 4
3
2 5
1 4
0 3


Output

4.2400000000 3.3200000000
3.5600000000 2.0800000000
2.8800000000 0.8400000000

Source: aizu | Difficulty: UNKNOWN_DIFFICULTY


Solutions:
import math

def equals(a, b):
	return abs(a - b) < 1e-10

class Point:

	def __init__(self, x=0, y=0):
		self.x = x
		self.y = y

	def __add__(self, p):
		return Point(self.x + p.x, self.y + p.y)

	def __sub__(self, p):
		return Point(self.x - p.x, self.y - p.y)

	def __mul__(self, a):
		return Point(self.x * a, self.y * a)

	def __rmul__(self, a):
		return self * a

	def __truediv__(self, a):
		return Point(self.x / a, self.y / a)

	def norm(self):
		return self.x * self.x + self.y * self.y

	def abs(self):
		return math.sqrt(self.norm())

	def __lt__(self, p):
		if self.x != p.x:
			return self.x < p.x
		else:
			return self.y < p.y

	def __eq__(self, p):
		return equals(self.x, p.x) and equals(self.y, p.y)

class Segment:

	def __init__(self, p1, p2):
		self.p1 = p1
		self.p2 = p2

def dot(a, b):
	return a.x * b.x + a.y * b.y

def cross(a, b):
	return a.x * b.y - a.y * b.x

def project(s, p):
	base = s.p2 - s.p1
	r = dot(p - s.p1, base) / base.norm()
	return s.p1 + base * r

def reflect(s, p):
	return p + (project(s, p) - p) * 2
(x1, y1, x2, y2) = [int(v) for v in input().split()]
s = Segment(Point(x1, y1), Point(x2, y2))
q = int(input())
ans = []
for i in range(q):
	(x, y) = [int(v) for v in input().split()]
	p = Point(x, y)
	ans.append(reflect(s, p))
for v in ans:
	print('{0:.10f} {1:.10f}'.format(v.x, v.y))


import sys
from itertools import starmap
readline = sys.stdin.readline

class Segment(object):
	__slots__ = ('fi', 'se')

	def __init__(self, fi, se):
		self.fi = fi
		self.se = se

def cross(a, b):
	return a.real * b.imag - a.imag * b.real

def dot(a, b):
	return a.real * b.real + a.imag * b.imag

def norm(base):
	return abs(base) ** 2

def project(s, p2):
	base = s.fi - s.se
	r = dot(p2 - s.fi, base) / norm(base)
	return s.fi + base * r

def reflect(s, p):
	return p + (project(s, p) - p) * 2.0
s = Segment(*starmap(complex, zip(*[map(float, readline().split())] * 2)))
n = int(readline())
for _ in [0] * n:
	p1 = reflect(s, complex(*map(float, readline().split())))
	print('{0:.10f} {1:.10f}'.format(p1.real, p1.imag))


(x1, y1, x2, y2) = map(int, input().split())
q = int(input())
(p1, p2) = (complex(x1, y1), complex(x2, y2))
p1p2 = p2 - p1
d2_p1p2 = p1p2.real ** 2 + p1p2.imag ** 2
while q:
	q -= 1
	p0 = complex(*map(int, input().split()))
	p1p0 = p0 - p1
	t = (p1p2.real * p1p0.real + p1p2.imag * p1p0.imag) / d2_p1p2
	ref = p0 + 2 * (p1p2 * t - p1p0)
	print(ref.real, ref.imag)


class Point(object):
	__slots__ = ['x', 'y']

	def __init__(self, x, y):
		self.x = x
		self.y = y

	def __iter__(self):
		yield self.x
		yield self.y

	def __add__(self, other: 'Point') -> 'Point':
		return Point(self.x + other.x, self.y + other.y)

	def __sub__(self, other: 'Point') -> 'Point':
		return Point(self.x - other.x, self.y - other.y)

	def __mul__(self, s: int):
		return Point(self.x * s, self.y * s)

	def project(self, vector: 'Vector') -> 'Point':
		return (vector * (Vector(vector.p1, self).dot(vector) / vector.norm)).p2

	def reflect(self, vector: 'Vector') -> 'Point':
		return self + (self.project(vector) - self) * 2

class Vector(object):
	__slots__ = ['p1', 'p2', 'x', 'y', 'norm', 'abs']

	def __init__(self, p1: Point, p2: Point):
		self.p1 = p1
		self.p2 = p2
		self.x = p2.x - p1.x
		self.y = p2.y - p1.y
		self.norm = self.x ** 2 + self.y ** 2
		self.abs = abs(self.x + self.y)

	def __mul__(self, s):
		return Vector(self.p1, Point(self.p1.x + self.x * s, self.p1.y + self.y * s))

	def __lt__(self, other: 'Vector'):
		return other.abs > self.abs

	def __gt__(self, other: 'Vector'):
		return other.abs < self.abs

	def dot(self, other: 'Vector'):
		return self.x * other.x + self.y * other.y

	def cross(self, other: 'Vector'):
		return self.x * other.y - self.y * other.x
(x1, y1, x2, y2) = map(int, input().split())
vector1 = Vector(Point(x1, y1), Point(x2, y2))
for point in (Point(*map(int, input().split())) for _ in [0] * int(input())):
	print(*point.reflect(vector1))


pp = list(map(int, input().split()))
n = int(input())

def project(bb, p=pp):
	ans = []
	a = (p[2] - p[0], p[3] - p[1])
	b = (bb[0] - p[0], bb[1] - p[1])
	if dot(a, b) < 0:
		a = (-a[0], -a[1])
	c = dot(a, b) / length(a) ** 2
	ans += [c * v + p[i] for (i, v) in enumerate(a)]
	return ans

def length(vector):
	ans = 0
	for i in vector:
		ans += i ** 2
	return ans ** (1 / 2)

def dot(a, b):
	n = len(a)
	if n != len(b):
		return None
	ans = 0
	for (i, j) in zip(a, b):
		ans += i * j
	return ans

def reflection(b, p=pp):
	a = project(b)
	ans = (b[0] + 2 * (a[0] - b[0]), b[1] + 2 * (a[1] - b[1]))
	print(f'{ans[0]:.8f} {ans[1]:.8f}')
for i in range(n):
	b = list(map(int, input().split()))
	reflection(b)


import math

class Point:

	def __init__(self, x, y):
		self.x = x
		self.y = y

	def __add__(self, p):
		return Point(self.x + p.x, self.y + p.y)

	def __sub__(self, p):
		return Point(self.x - p.x, self.y - p.y)

	def __mul__(self, p):
		return Point(self.x * p, self.y * p)

def Dot(a, b):
	return a.x * b.x + a.y * b.y

def Cross(a, b):
	return a.x * b.y - a.y * b.x

def Dis(a, b):
	return math.sqrt((a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y))

def Dis2(a, b):
	return (a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y)
(x1, y1, x2, y2) = map(int, input().split())
p1 = Point(x1, y1)
p2 = Point(x2, y2)
p1p2_dis2 = Dis2(p1, p2)
q = int(input())
for i in range(q):
	(x, y) = map(int, input().split())
	p = Point(x, y)
	dot_res = Dot(p - p1, p2 - p1)
	h = (p2 - p1) * (dot_res / p1p2_dis2) + p1
	p_ = h + (h - p)
	print(p_.x, p_.y)


(a, b, c, d) = map(float, input().split())
a = complex(a, b)
b = complex(c, d)
for _ in range(int(input())):
	c = complex(*map(float, input().split()))
	q = b - a
	c -= a
	p = a + q * (c / q).conjugate()
	print(p.real, p.imag)


from math import pi, cos, sin, atan2
EPS = 10 ** (-9)

def eq(value1, value2):
	return abs(value1 - value2) <= EPS

class Point:

	def __init__(self, x, y):
		self.x = x
		self.y = y
		self.arg = atan2(y, x)

	def __str__(self):
		return '{0:.8f} {1:.8f}'.format(self.x, self.y)

	def __add__(self, other):
		return Point(self.x + other.x, self.y + other.y)

	def __sub__(self, other):
		return Point(self.x - other.x, self.y - other.y)

	def __mul__(self, scal):
		return Point(self.x * scal, self.y * scal)

	def __truediv__(self, scal):
		return Point(self.x / scal, self.y / scal)

	def __eq__(self, other):
		return eq(self.x, other.x) and eq(self.y, other.y)

	def __abs__(self):
		return (self.x ** 2 + self.y ** 2) ** 0.5

def Rotation(vec: Point, rad):
	return Point(vec.x * cos(rad) - vec.y * sin(rad), vec.x * sin(rad) + vec.y * cos(rad))

class Circle:

	def __init__(self, p, r):
		self.p = p
		self.r = r

class Line:

	def __init__(self, a, b):
		self.a = a
		self.b = b
		self.arg = (a - b).arg % pi

	def __str__(self):
		return '[({0}, {1}) - ({2}, {3})]'.format(self.a.x, self.a.y, self.b.x, self.b.y)

	def par(self, point):
		return Line(point, point + (self.a - self.b))

	def tan(self, point):
		return Line(point, point + Rotation(self.a - self.b, pi / 2))

class Segment(Line):

	def __init__(self, a, b):
		super(Line, self).__init__(a, b)

def cross(vec1: Point, vec2: Point):
	return vec1.x * vec2.y - vec1.y * vec2.x

def dot(vec1: Point, vec2: Point):
	return vec1.x * vec2.x + vec1.y * vec2.y

def ccw(a, b, c):
	if cross(b - a, c - a) > EPS:
		return +1
	if cross(b - a, c - a) < -EPS:
		return -1
	if dot(c - a, b - a) < -EPS:
		return +2
	if abs(b - a) < abs(c - a):
		return -2
	return 0

def projection(l, p):
	t = dot(l.b - l.a, p - l.a) / abs(l.a - l.b) ** 2
	return l.a + (l.b - l.a) * t

def reflection(l, p):
	return p + (projection(l, p) - p) * 2

def isPararell(l1, l2):
	return eq(cross(l1.a - l1.b, l2.a - l2.b), 0)

def isVertical(l1, l2):
	return eq(dot(l1.a - l1.b, l2.a - l2.b), 0)

def isIntersect_lp(l, p):
	return abs(ccw(l.a, l.b, p)) != 1

def isIntersect_ll(l1, l2):
	return not isPararell(l1, l2) or isIntersect_lp(l1, l2.a)

def isIntersect_sp(s, p):
	return ccw(s.a, s.b, p) == 0

def isIntersect_ss(s1, s2):
	return ccw(s1.a, s1.b, s2.a) * ccw(s1.a, s1.b, s2.b) <= 0 and ccw(s2.a, s2.b, s1.a) * ccw(s2.a, s2.b, s1.b) <= 0

def isIntersect_ls(l, s):
	return cross(l.b - l.a, s.a - l.a) * cross(l.b - l.a, s.b - l.a) < EPS

def isIntersect_cp(c, p):
	return abs(abs(c.p - p) - c.r) < EPS

def isIntersect_cl(c, l):
	return distance_lp(l, c.p) <= c.r + EPS

def isIntersect_cs(c, s):
	pass

def isIntersect_cc(c1, c2):
	pass

def distance_pp(p1, p2):
	return abs(p1 - p2)

def distance_lp(l, p):
	return abs(projection(l, p) - p)

def distance_ll(l1, l2):
	return 0 if isIntersect_ll(l1, l2) else distance_lp(l1, l2.a)

def distance_sp(s, p):
	r = projection(s, p)
	if isIntersect_sp(s, r):
		return abs(r - p)
	return min(abs(s.a - p), abs(s.b - p))

def distance_ss(s1, s2):
	if isIntersect_ss(s1, s2):
		return 0
	return min([distance_sp(s1, s2.a), distance_sp(s1, s2.b), distance_sp(s2, s1.a), distance_sp(s2, s1.b)])

def distance_ls(l, s):
	if isIntersect_ls(l, s):
		return 0
	return min(distance_lp(l, s.a), distance_lp(l, s.b))

def crosspoint_ll(l1, l2):
	A = cross(l1.b - l1.a, l2.b - l2.a)
	B = cross(l1.b - l1.a, l1.b - l2.a)
	if eq(abs(A), 0) and eq(abs(B), 0):
		return l2.a
	return l2.a + (l2.b - l2.a) * B / A

def crosspoint_ss(s1, s2):
	return crosspoint_ll(s1, s2)

def crosspoint_lc(l, c):
	if eq(distance_lp(l, c.p), c.r):
		return [c.p]
	p = projection(l, c.p)
	e = (l.b - l.a) / abs(l.b - l.a)
	dis = (c.r ** 2 - abs(p - c.p) ** 2) ** 0.5
	return [p + e * dis, p - e * dis]

def crosspoint_sc(s, c):
	pass

def crosspoint_cc(c1, c2):
	d = abs(c1.p - c2.p)
	if not abs(c1.r - c2.r) <= d <= c1.r + c2.r:
		return []
	mid_p = (c2.p * (c1.r ** 2 - c2.r ** 2 + d ** 2) + c1.p * (c2.r ** 2 - c1.r ** 2 + d ** 2)) / (2 * d ** 2)
	tanvec = Rotation(c1.p - c2.p, pi / 2)
	return crosspoint_lc(Line(mid_p, mid_p + tanvec), c1)

def tangent_cp(c, p):
	return crosspoint_cc(c, Circle(p, (abs(p - c.p) ** 2 - c.r ** 2) ** 0.5))
import sys
input = sys.stdin.readline

def verify_1A():
	(p1x, p1y, p2x, p2y) = map(int, input().split())
	l = Line(Point(p1x, p1y), Point(p2x, p2y))
	Q = int(input())
	Query = [list(map(int, input().split())) for _ in range(Q)]
	for (px, py) in Query:
		p = Point(px, py)
		print(projection(l, p))

def verify_1B():
	(p1x, p1y, p2x, p2y) = map(int, input().split())
	l = Line(Point(p1x, p1y), Point(p2x, p2y))
	Q = int(input())
	Query = [list(map(int, input().split())) for _ in range(Q)]
	for (px, py) in Query:
		p = Point(px, py)
		print(reflection(l, p))
verify_1B()


import array
from fractions import Fraction
import math
import os
import sys

class Vec(object):

	def __init__(self, x, y):
		self.x = x
		self.y = y
		super().__init__()

	def __add__(self, other):
		return Vec(self.x + other.x, self.y + other.y)

	def __sub__(self, other):
		return Vec(self.x - other.x, self.y - other.y)

	def __mul__(self, scalar):
		return Vec(self.x * scalar, self.y * scalar)

	def __rmul__(self, scalar):
		return Vec(self.x * scalar, self.y * scalar)

	def __truediv__(self, scalar):
		return Vec(self.x / scalar, self.y / scalar)

	def __iadd__(self, other):
		self.x += other.x
		self.y += other.y
		return self

	def __isub__(self, other):
		self.x -= other.x
		self.y -= other.y
		return self

	def __imul__(self, scalar):
		self.x *= scalar
		self.y *= scalar
		return self

	def __idiv__(self, scalar):
		self.x /= scalar
		self.y /= scalar
		return self

	def __neg__(self):
		return Vec(-self.x, -self.y)

	def dot(self, other):
		return self.x * other.x + self.y * other.y

	def cross(self, other):
		return self.x * other.y - self.y * other.x

	def abs2(self):
		return self.x * self.x + self.y * self.y

	def __abs__(self):
		return math.sqrt(float(self.abs2()))

	def __str__(self):
		return '({}, {})'.format(self.x, self.y)

def main():
	(x1, y1, x2, y2) = read_ints()
	Q = read_int()
	for _ in range(Q):
		(x, y) = read_ints()
		print(*solve(Vec(x1, y1), Vec(x2, y2), Vec(x, y)))

def solve(u, v, a):
	v -= u
	a -= u
	b = Fraction(2 * v.dot(a), v.abs2()) * v - a
	b += u
	return (float(b.x), float(b.y))
DEBUG = 'DEBUG' in os.environ

def inp():
	return sys.stdin.readline().rstrip()

def read_int():
	return int(inp())

def read_ints():
	return [int(e) for e in inp().split()]

def dprint(*value, sep=' ', end='\n'):
	if DEBUG:
		print(*value, sep=sep, end=end)
main()


import math
EPS = 1e-10

class Point:

	def __init__(self, x, y):
		self.x = x
		self.y = y

	def __sub__(self, p):
		return Point(self.x - p.x, self.y - p.y)

	def __add__(self, p):
		return Point(self.x + p.x, self.y + p.y)

	def __mul__(self, a):
		return Point(self.x * a, self.y * a)

	def __truediv__(self, a):
		return Point(self.x / a, self.y / a)

	def __str__(self):
		return str(self.x) + ',' + str(self.y)

	def __repr__(self):
		return 'Point(' + str(self.x) + ',' + str(self.y) + ')'

	def __lt__(self, other):
		if self.y - other.y == 0:
			return self.x < other.x
		else:
			return self.y < other.y

	def __eq__(self, other):
		return abs(self.x - other.x) < EPS and abs(self.y - other.y) < EPS

class Segment:

	def __init__(self, p1, p2):
		self.p1 = p1
		self.p2 = p2

	def __str__(self):
		return 'segment:(' + str(self.p1) + ';' + str(self.p2) + ')'

	def __repr__(self):
		return 'segment:(' + str(self.p1) + ';' + str(self.p2) + ')'

class Circle:

	def __init__(self, c, r):
		self.c = c
		self.r = r

	def __str__(self):
		return 'Circle:(center point: ' + str(self.c) + '; radius: ' + str(self.r) + ')'

	def __repr__(self):
		return 'Circle:(center point: ' + str(self.c) + '; radius: ' + str(self.r) + ')'

class Polygon:

	def __init__(self, ps=[]):
		self.ps = ps
		self.size = len(ps)

	def __getitem__(self, i):
		return self.ps[i]

	def __setitem__(self, i, p):
		self.ps[i] = p

	def __iter__(self):
		return self.ps

	def addpoint(self, i, p):
		self.ps.insert(i, p)
		self.size += 1

	def delpoint(self, i):
		self.size -= 1
		return self.ps.pop(i)

	def sortYX(self):
		self.ps.sort()

	def __str__(self):
		return 'Polygon:' + str(tuple(self.ps))

	def __repr__(self):
		return 'Polygon:' + str(tuple(self.ps))

	def __len__(self):
		return len(self.ps)

	def __eq__(self, other):
		return self.ps == other.ps

	def draw(self):
		turtle.screensize(800, 800, 'black')
		turtle.title('Polygon convex hull')
		turtle.setworldcoordinates(-400, -400, 400, 400)
		t = turtle.Turtle()
		t.pencolor('red')
		for pt in self.ps:
			t.goto(pt.x, pt.y)
			t.dot(10, 'white')

def norm(p):
	return p.x * p.x + p.y * p.y

def length(p):
	return math.sqrt(p.x * p.x + p.y * p.y)

def dot(a, b):
	return a.x * b.x + a.y * b.y

def cross(a, b):
	return a.x * b.y - a.y * b.x

def project(s, p):
	base = s.p2 - s.p1
	r = dot(p - s.p1, base) / norm(base)
	return s.p1 + base * r

def getDistance(a, b):
	return length(a - b)

def getDistanceLP(l, p):
	return abs(cross(l.p2 - l.p1, p - l.p1) / length(l.p2 - l.p1))

def getDistanceSP(s, p):
	if dot(s.p2 - s.p1, p - s.p1) < 0.0:
		return length(p - s.p1)
	if dot(s.p1 - s.p2, p - s.p2) < 0.0:
		return length(p - s.p2)
	return getDistanceLP(s, p)

def isOrthogonalSG(s1, s2):
	return abs(dot(s1.p2 - s1.p1, s2.p2 - s2.p1)) < EPS

def isParallelLN(s1, s2):
	return abs(cross(s1.p2 - s1.p1, s2.p2 - s2.p1)) < 0
COUNTER_CLOCKWISE = 1
CLOCKWISE = -1
ONLINE_BACK = -2
ONLINE_FRONT = 2
ON_SEGMENT = 0

def ccw(p0, p1, p2):
	a = p1 - p0
	b = p2 - p0
	if cross(a, b) > EPS:
		return COUNTER_CLOCKWISE
	if cross(a, b) < -EPS:
		return CLOCKWISE
	if dot(a, b) < -EPS:
		return ONLINE_BACK
	if norm(a) < norm(b):
		return ONLINE_FRONT
	return ON_SEGMENT

def toleft(p0, p1, p2):
	a = p1 - p0
	b = p2 - p0
	tmp = cross(a, b)
	if tmp > EPS:
		return 1
	elif abs(tmp) < EPS and norm(a) <= norm(b):
		return 2
	elif abs(tmp) < EPS and norm(a) > norm(b):
		return -2
	else:
		return -1

def reflect(s, p):
	return p + (project(s, p) - p) * 2.0
s = [int(x) for x in input().split()]
p1 = Point(s[0], s[1])
p2 = Point(s[2], s[3])
sg = Segment(p1, p2)
q = int(input())
for i in range(0, q):
	s = [int(x) for x in input().split()]
	p3 = Point(s[0], s[1])
	pt = reflect(sg, p3)
	print(pt.x, pt.y)


import sys
input = sys.stdin.readline

class Vector:

	def __init__(self, x, y):
		self.x = x
		self.y = y

	def __add__(self, vec):
		return Vector(self.x + vec.x, self.y + vec.y)

	def __sub__(self, vec):
		return Vector(self.x - vec.x, self.y - vec.y)

	def __mul__(self, sc):
		return Vector(self.x * sc, self.y * sc)

	def __truediv__(self, sc):
		return Vector(self.x / sc, self.y / sc)

	def __iadd__(self, vec):
		self.x += vec.x
		self.y += vec.y
		return self

	def __isub__(self, vec):
		self.x -= vec.x
		self.y -= vec.y
		return self

	def __imul__(self, sc):
		self.x *= sc
		self.y *= sc
		return self

	def __itruediv__(self, sc):
		self.x /= sc
		self.y /= sc
		return self

	def __str__(self):
		return '{:.9f} {:.9f}'.format(self.x, self.y)

	def __eq__(self, vec):
		return self.x == vec.x and self.y == vec.y

	def dot(self, vec):
		return self.x * vec.x + self.y * vec.y

	def abs(self):
		return (self.x * self.x + self.y * self.y) ** 0.5

	def ortho(self):
		return Vector(-self.y, self.x)
(x1, y1, x2, y2) = map(int, input().split())
v1 = Vector(x1, y1)
v2 = Vector(x2, y2)
n = v2 - v1
n /= n.abs()
m = n.ortho()
for _ in [0] * int(input()):
	(x, y) = map(int, input().split())
	v = Vector(x, y) - v1
	u = v - m * v.dot(m) * 2
	print(v1 + u)


def dprod(v1, v2):
	(x1, y1) = v1
	(x2, y2) = v2
	return x1 * x2 + y1 * y2

def proj(p1, p2, p):
	(x1, y1) = p1
	(x2, y2) = p2
	(x, y) = p
	v1 = (x2 - x1, y2 - y1)
	v2 = (x - x1, y - y1)
	r = dprod(v1, v2) / dprod(v1, v1)
	return (x1 + r * v1[0], y1 + r * v1[1])

def refl(p1, p2, p):
	(px, py) = p
	(hx, hy) = proj(p1, p2, p)
	return (px + 2.0 * (hx - px), py + 2.0 * (hy - py))

def run():
	(x1, y1, x2, y2) = [int(i) for i in input().split()]
	q = int(input())
	for _ in range(q):
		(x, y) = [int(i) for i in input().split()]
		print('{:.10f} {:.10f}'.format(*refl((x1, y1), (x2, y2), (x, y))))
run()


def inner_product(v1, v2):
	return v1.real * v2.real + v1.imag * v2.imag

def project(a, b):
	return a * inner_product(a, b) / abs(a) ** 2

def reflect(p0, p1, p2):
	a = p1 - p0
	b = p2 - p0
	v = project(a, b)
	u = v - b
	p3 = p2 + 2 * u
	return p3

def main():
	(x_p0, y_p0, x_p1, y_p1) = map(float, input().split())
	p0 = complex(x_p0, y_p0)
	p1 = complex(x_p1, y_p1)
	q = int(input())
	for _ in range(q):
		p2 = complex(*map(float, input().split()))
		t = reflect(p0, p1, p2)
		print('{:.10f} {:.10f}'.format(t.real, t.imag))
main()


(xp1, yp1, xp2, yp2) = map(int, input().split())
q = int(input())
xp = complex(xp2 - xp1, yp2 - yp1)
for _ in range(q):
	(x, y) = map(int, input().split())
	xpi = complex(x - xp1, y - yp1)
	dot = xp.real * xpi.real + xp.imag * xpi.imag
	v1 = dot * xp / abs(xp) ** 2
	v2 = v1 - xpi
	ans = complex(x, y) + v2 * 2
	print('{:.9f} {:.9f}'.format(ans.real, ans.imag))


from sys import stdin

class Vector:

	def __init__(self, x=None, y=None):
		self.x = x
		self.y = y

	def __add__(self, other):
		return Vector(self.x + other.x, self.y + other.y)

	def __sub__(self, other):
		return Vector(self.x - other.x, self.y - other.y)

	def __mul__(self, k):
		return Vector(self.x * k, self.y * k)

	def __gt__(self, other):
		return self.x > other.x and self.y > other.y

	def __eq__(self, other):
		return self.x == other.x and self.y == other.y

	def dot(self, other):
		return self.x * other.x + self.y * other.y

	def cross(self, other):
		return self.x * other.y - self.y * other.x

	def norm(self):
		return self.x * self.x + self.y * self.y

	def abs(self):
		return math.sqrt(self.norm())

class Point(Vector):

	def __init__(self, *args, **kargs):
		return super().__init__(*args, **kargs)

class Segment:

	def __init__(self, p1=Point(0, 0), p2=Point(1, 1)):
		self.p1 = p1
		self.p2 = p2

def project(s, p):
	base = s.p2 - s.p1
	hypo = p - s.p1
	r = hypo.dot(base) / base.norm()
	return s.p1 + base * r

def reflect(s, p):
	return p + (project(s, p) - p) * 2

def read_and_print_results(s, n):
	for _ in range(n):
		line = stdin.readline().strip().split()
		p = Vector(int(line[0]), int(line[1]))
		x = reflect(s, p)
		print('{0:0.10f} {1:0.10f}'.format(x.x, x.y))
(x1, y1, x2, y2) = input().split()
p1 = Point(int(x1), int(y1))
p2 = Point(int(x2), int(y2))
s = Segment(p1, p2)
n = int(input())
read_and_print_results(s, n)


(sx, sy, ex, ey) = (int(n) for n in input().split(' '))
trial = int(input())
for _ in range(trial):
	(x, y) = (int(n) for n in input().split(' '))
	if sx == ex:
		print(-x, y)
	elif sy == ey:
		print(x, -y)
	else:
		grad = (ey - sy) / (ex - sx)
		y_seg = sy - grad * sx
		per_grad = -1 / grad
		per_y_seg = y - per_grad * x
		ans_x = (y_seg - per_y_seg) / (-1 * (grad - per_grad))
		ans_y = per_grad * ans_x + per_y_seg
		diff_x = ans_x - x
		diff_y = diff_x * per_grad
		print(ans_x + diff_x, ans_y + diff_y)


def Reflection(point, begin, end):
	tmp = (point - begin) / (end - begin)
	return tmp.conjugate() * (end - begin) + begin
(a, b, c, d) = map(int, input().split())
(q, r) = (complex(a, b), complex(c, d))
n = int(input())
for _ in range(n):
	(x, y) = map(int, input().split())
	p = complex(x, y)
	refl = Reflection(p, q, r)
	print(refl.real, refl.imag)


(x1, y1, x2, y2) = map(int, input().split())
(p1, p2) = (complex(x1, y1), complex(x2, y2))
a = p2 - p1
dis = (x1 - x2) ** 2 + (y1 - y2) ** 2
for i in range(int(input())):
	p = complex(*map(int, input().split()))
	b = p - p1
	co = (a.real * b.real + a.imag * b.imag) / dis
	ans = p + 2 * (co * a - b)
	print(ans.real, ans.imag)


import math
from typing import Union

class Point(object):
	__slots__ = ['x', 'y']

	def __init__(self, x, y):
		self.x = x
		self.y = y

	def __add__(self, other):
		return Point(self.x + other.x, self.y + other.y)

	def __sub__(self, other):
		return Point(self.x - other.x, self.y - other.y)

	def __mul__(self, other: Union[int, float]):
		return Point(self.x * other, self.y * other)

	def __repr__(self):
		return f'({self.x},{self.y})'

class Segment(object):
	__slots__ = ['pt1', 'pt2', 'vector']

	def __init__(self, x: Point, y: Point):
		self.pt1 = x
		self.pt2 = y
		self.vector = self.pt2 - self.pt1

	def dot(self, other):
		return self.vector.x * other.vector.x + self.vector.y * other.vector.y

	def cross(self, other):
		return self.vector.x * other.vector.y - self.vector.y * other.vector.x

	def norm(self):
		return pow(self.vector.x, 2) + pow(self.vector.y, 2)

	def abs(self):
		return math.sqrt(self.norm())

	def projection(self, pt: Point) -> Point:
		t = self.dot(Segment(self.pt1, pt)) / pow(self.abs(), 2)
		return Point(self.pt1.x + t * self.vector.x, self.pt1.y + t * self.vector.y)

	def reflection(self, pt: Point) -> Point:
		return self.projection(pt) * 2 - pt

	def __repr__(self):
		return f'{self.pt1},{self.pt2},{self.vector}'

def main():
	(p0_x, p0_y, p1_x, p1_y) = map(int, input().split())
	seg = Segment(Point(p0_x, p0_y), Point(p1_x, p1_y))
	num_query = int(input())
	for i in range(num_query):
		(pt_x, pt_y) = map(int, input().split())
		reflection = seg.reflection(Point(pt_x, pt_y))
		print('{:.10f} {:.10f}'.format(reflection.x, reflection.y))
	return
main()


import sys
from sys import stdin
input = stdin.readline

class Point(object):
	epsilon = 1e-10

	def __init__(self, x=0.0, y=0.0):
		if isinstance(x, tuple):
			self.x = x[0]
			self.y = x[1]
		else:
			self.x = x
			self.y = y

	def __add__(self, other):
		return Point(self.x + other.x, self.y + other.y)

	def __sub__(self, other):
		return Point(self.x - other.x, self.y - other.y)

	def __mul__(self, other):
		return Point(other * self.x, other * self.y)

	def __truediv__(self, other):
		return Point(other / self.x, other / self.y)

	def __lt__(self, other):
		if self.x == other.x:
			return self.y < other.y
		else:
			return self.x < other.x

	def __eq__(self, other):
		from math import fabs
		if fabs(self.x - other.x) < Point.epsilon and fabs(self.y - other.y) < Point.epsilon:
			return True
		else:
			return False

	def norm(self):
		return self.x * self.x + self.y * self.y

	def abs(self):
		from math import sqrt
		return sqrt(self.norm())

class Vector(Point):

	def __init__(self, x=0.0, y=0.0):
		if isinstance(x, tuple):
			self.x = x[0]
			self.y = x[1]
		elif isinstance(x, Point):
			self.x = x.x
			self.y = x.y
		else:
			self.x = x
			self.y = y

	def __add__(self, other):
		return Vector(self.x + other.x, self.y + other.y)

	def __sub__(self, other):
		return Vector(self.x - other.x, self.y - other.y)

	def __mul__(self, other):
		return Vector(other * self.x, other * self.y)

	def __truediv__(self, other):
		return Vector(other / self.x, other / self.y)

	@classmethod
	def dot(cls, a, b):
		return a.x * b.x + a.y * b.y

	@classmethod
	def cross(cls, a, b):
		return a.x * b.y - a.y * b.x

	@classmethod
	def is_orthogonal(cls, a, b):
		return Vector.dot(a, b) == 0.0

	@classmethod
	def is_parallel(cls, a, b):
		return Vector.cross(a, b) == 0.0

class Segment(object):

	def __init__(self, p1=Point(), p2=Point()):
		if isinstance(p1, Point):
			self.p1 = p1
			self.p2 = p2
		elif isinstance(p1, tuple):
			self.p1 = Point(p1[0], p1[1])
			self.p2 = Point(p2[0], p2[1])

	@classmethod
	def is_orthogonal(cls, s1, s2):
		a = Vector(s1.p2 - s1.p1)
		b = Vector(s2.p2 - s2.p1)
		return Vector.is_orthogonal(a, b)

	@classmethod
	def is_parallel(cls, s1, s2):
		a = Vector(s1.p2 - s1.p1)
		b = Vector(s2.p2 - s2.p1)
		return Vector.is_parallel(a, b)

class Line(Segment):
	pass

class Cirle(object):

	def __init__(self, c=Point(), r=0.0):
		self.c = c
		self.r = r

def project(s, p):
	base = Vector(s.p2 - s.p1)
	a = Vector(p - s.p1)
	r = Vector.dot(a, base)
	r /= base.norm()
	return s.p1 + base * r

def reflect(s, p):
	proj = project(s, p)
	return p + (proj - p) * 2

def main(args):
	(x_p1, y_p1, x_p2, y_p2) = map(int, input().split())
	q = int(input())
	s = Segment((x_p1, y_p1), (x_p2, y_p2))
	for _ in range(q):
		(x, y) = map(int, input().split())
		p = Point(x, y)
		result = reflect(s, p)
		print('{:.10f} {:.10f}'.format(result.x, result.y))
main(sys.argv[1:])


import math
EPS = 1e-10

class Segment:

	def __init__(self, p1, p2):
		self.p1 = p1
		self.p2 = p2

class Point:

	def __init__(self, x, y):
		self.x = x
		self.y = y

	def __add__(self, point):
		return Point(self.x + point.x, self.y + point.y)

	def __sub__(self, point):
		return Point(self.x - point.x, self.y - point.y)

	def __mul__(self, a):
		return Point(a * self.x, a * self.y)

	def __truediv__(self, a):
		return Point(self.x / a, self.y / a)

	def __abs__(self):
		return math.sqrt(self.norm())

	def norm(self):
		return self.x ** 2 + self.y ** 2

	def __eq__(self, point):
		return abs(self.x - point.x) < EPS and abs(self.y - point.y) < EPS

def dot(a, b):
	return a.x * b.x + a.y * b.y

def cross(a, b):
	return a.x * b.y - a.y * b.x

def isOrthogonal(a, b):
	return dot(a, b) == 0

def isParallel(a, b):
	return cross(a, b) == 0

def project(s, p):
	base = s.p2 - s.p1
	r = dot(p - s.p1, base) / base.norm()
	return s.p1 + base * r

def reflect(s, p):
	return p + (project(s, p) - p) * 2
from sys import stdin
input = stdin.readline
(x1, y1, x2, y2) = map(int, input().split())
s = Segment(Point(x1, y1), Point(x2, y2))
q = int(input())
for _ in range(q):
	(x0, y0) = map(int, input().split())
	p = Point(x0, y0)
	reflection = reflect(s, p)
	print(reflection.x, reflection.y)


(a, b, c, d) = map(float, input().split())
a = complex(a, b)
b = complex(c, d)
for _ in [0] * int(input()):
	c = complex(*map(float, input().split()))
	q = b - a
	c -= a
	p = a + q * (c / q).conjugate()
	print(p.real, p.imag)


import sys
sys.setrecursionlimit(10 ** 9)

def input():
	return sys.stdin.readline().strip()

def INT():
	return int(input())

def MAP():
	return map(int, input().split())

def LIST():
	return list(map(int, input().split()))
INF = float('inf')

class Geometry:

	def add(self, a, b):
		(x1, y1) = a
		(x2, y2) = b
		return (x1 + x2, y1 + y2)

	def sub(self, a, b):
		(x1, y1) = a
		(x2, y2) = b
		return (x1 - x2, y1 - y2)

	def mul(self, a, b):
		(x1, y1) = a
		if not isinstance(b, tuple):
			return (x1 * b, y1 * b)
		(x2, y2) = b
		return (x1 * x2, y1 * y2)

	def dot(self, a, b):
		(x1, y1) = a
		(x2, y2) = b
		return x1 * x2 + y1 * y2

	def norm(self, a):
		(x, y) = a
		return x ** 2 + y ** 2

	def project(self, seg, p):
		(p1, p2) = seg
		base = self.sub(p2, p1)
		r = self.dot(self.sub(p, p1), base) / self.norm(base)
		return self.add(p1, self.mul(base, r))

	def reflect(self, seg, p):
		return self.add(p, self.mul(self.sub(self.project(seg, p), p), 2))
gm = Geometry()
(x1, y1, x2, y2) = MAP()
seg = ((x1, y1), (x2, y2))
Q = INT()
for i in range(Q):
	(x, y) = MAP()
	res = gm.reflect(seg, (x, y))
	print(*res)


EPS = 10 ** (-9)

def is_equal(a, b):
	return abs(a - b) < EPS

def norm(v, i):
	import math
	ret = 0
	n = len(v)
	for j in range(n):
		ret += abs(v[j]) ** i
	return math.pow(ret, 1 / i)

class Vector(list):

	def __add__(self, other):
		n = len(self)
		ret = [0] * n
		for i in range(n):
			ret[i] = super().__getitem__(i) + other.__getitem__(i)
		return self.__class__(ret)

	def __radd__(self, other):
		n = len(self)
		ret = [0] * n
		for i in range(n):
			ret[i] = other.__getitem__(i) + super().__getitem__(i)
		return self.__class__(ret)

	def __iadd__(self, other):
		n = len(self)
		for i in range(n):
			self[i] += other.__getitem__(i)
		return self

	def __sub__(self, others):
		n = len(self)
		ret = [0] * n
		for i in range(n):
			ret[i] = super().__getitem__(i) - others.__getitem__(i)
		return self.__class__(ret)

	def __iadd__(self, other):
		n = len(self)
		for i in range(n):
			self[i] -= other.__getitem__(i)
		return self

	def __rsub__(self, others):
		n = len(self)
		ret = [0] * n
		for i in range(n):
			ret[i] = others.__getitem__(i) - super().__getitem__(i)
		return self.__class__(ret)

	def __mul__(self, other):
		n = len(self)
		if isinstance(other, list):
			ret = 0
			for i in range(n):
				ret += super().__getitem__(i) * other.__getitem__(i)
			return ret
		else:
			ret = [0] * n
			for i in range(n):
				ret[i] = super().__getitem__(i) * other
			return self.__class__(ret)

	def __rmul__(self, other):
		n = len(self)
		if isinstance(other, list):
			ret = 0
			for i in range(n):
				ret += super().__getitem__(i) * other.__getitem__(i)
			return ret
		else:
			ret = [0] * n
			for i in range(n):
				ret[i] = super().__getitem__(i) * other
			return self.__class__(ret)

	def __truediv__(self, other):
		n = len(self)
		ret = [0] * n
		for i in range(n):
			ret[i] = super().__getitem__(i) / other
		return self.__class__(ret)

	def norm(self, i):
		return norm(self, i)

	def __pow__(self, other):
		n = len(self)
		ret = [0] * 3
		x = self[:]
		y = other[:]
		if n == 2:
			x.append(0)
			y.append(0)
		if n == 2 or n == 3:
			for i in range(3):
				(ret[0], ret[1], ret[2]) = (x[1] * y[2] - x[2] * y[1], x[2] * y[0] - x[0] * y[2], x[0] * y[1] - x[1] * y[0])
			ret = Vector(ret)
			if n == 2:
				return ret.norm(2)
			else:
				return ret

class Segment:

	def __init__(self, v1, v2):
		self.v1 = v1
		self.v2 = v2

class Line(Segment):

	def get_unit_vec(self):
		return (self.v2 - self.v1) / norm(self.v2 - self.v1, 2)

	def projection(self, vector):
		unit_vec = self.get_unit_vec()
		t = unit_vec * (vector - self.v1)
		return self.v1 + t * unit_vec

	def is_vertical(self, other):
		return is_equal(0, self.get_unit_vec() * other.get_unit_vec())

	def is_horizontal(self, other):
		return is_equal(0, self.get_unit_vec() ** other.get_unit_vec())

	def reflection(self, vector):
		projection = self.projection(vector)
		v = projection - vector
		return projection + v
(xp1, yp1, xp2, yp2) = map(float, input().split())
q = int(input())
ps = [list(map(int, input().split())) for i in range(q)]
p1 = Vector([xp1, yp1])
p2 = Vector([xp2, yp2])
L = Line(p1, p2)
for p in ps:
	ans = L.reflection(p)
	ans = [float(round(a, 11)) for a in ans]
	print(*ans)


import sys
input = sys.stdin.readline

def main():
	(x1, y1, x2, y2) = map(int, input().split())
	q = int(input())
	if x2 - x1 == 0:
		for i in range(q):
			(xp, yp) = map(int, input().split())
			print(xp + 2 * (x1 - xp), yp)
	else:
		m = (y2 - y1) / (x2 - x1)
		for i in range(q):
			(xp, yp) = map(int, input().split())
			yq = (2 * m * (xp - x1) + yp * (m * m - 1) + 2 * y1) / (1 + m * m)
			xq = xp - m * (yq - yp)
			print(xq, yq)
main()


(x1, y1, x2, y2) = map(float, input().split())
det = x1 - x2
if det != 0:
	a = (y1 - y2) / det
	b = (-(y1 * x2) + y2 * x1) / det
q = int(input())
(x, y) = ([], [])
for i in range(q):
	(x_t, y_t) = map(float, input().split())
	x.append(x_t)
	y.append(y_t)
if det == 0:
	for i in range(q):
		print(-x[i], y[i])
elif y2 == y1:
	for i in range(q):
		print(x[i], -y[i])
else:
	for i in range(q):
		k = y[i] + 1 / a * x[i]
		s = (k - b) / (a + 1 / a)
		print(s + (s - x[i]), -1 / a * (s + (s - x[i])) + k)


class Point:

	def __init__(self, x, y):
		self.x = x
		self.y = y

	def __add__(self, other):
		return Point(self.x + other.x, self.y + other.y)

	def __sub__(self, other):
		return Point(self.x - other.x, self.y - other.y)

	def __mul__(self, other):
		return Point(self.x * other, self.y * other)

	def __floordiv__(self, other):
		return Point(self.x / other, self.y / other)

	def __repr__(self):
		return str(self.x) + ' ' + str(self.y)

class Vector(Point):
	pass

class Segment:

	def __init__(self, p1, p2):
		self.p1 = p1
		self.p2 = p2

def points_to_vector(p1, p2):
	x = p1.x - p2.x
	y = p1.y - p2.y
	return Vector(x, y)

def vector(p):
	return Vector(p.x, p.y)

def dot(v1, v2):
	return v1.x * v2.x + v1.y * v2.y

def cross(v1, v2):
	return v1.x * v2.y - v1.y * v2.x

def norm(v):
	return v.x ** 2 + v.y ** 2

def project(s, p):
	base = points_to_vector(s.p1, s.p2)
	hypo = points_to_vector(p, s.p1)
	r = dot(hypo, base) / norm(base)
	return s.p1 + base * r

def reflect(s, p):
	return p + (project(s, p) - p) * 2
import sys
s = list(map(int, input().split()))
p1 = Point(s[0], s[1])
p2 = Point(s[2], s[3])
segment = Segment(p1, p2)
q = int(input())
for i in range(q):
	(x, y) = map(int, input().split())
	p = Point(x, y)
	ans = reflect(segment, p)
	print(ans)


def reflection(line, point):
	(x0, y0, x1, y1) = line
	(p, q) = point
	x1 -= x0
	y1 -= y0
	p -= x0
	q -= y0
	cv = p * x1 + q * y1
	sv = p * y1 - q * x1
	cv2 = cv ** 2 - sv ** 2
	sv2 = 2 * cv * sv
	dd = (p ** 2 + q ** 2) * (x1 ** 2 + y1 ** 2)
	if dd == 0:
		return (x0 + p, y0 + q)
	return (x0 + (cv2 * p - sv2 * q) / dd, y0 + (sv2 * p + cv2 * q) / dd)

def solve():
	(x0, y0, x1, y1) = map(int, input().split())
	q = int(input())
	for i in range(q):
		(x, y) = map(int, input().split())
		print('%.16f %.16f' % reflection((x0, y0, x1, y1), (x, y)))
solve()


from sys import stdin
readline = stdin.readline

def main():
	(x1, y1, x2, y2) = map(int, readline().split())
	(p1, p2) = (x1 + y1 * 1j, x2 + y2 * 1j)
	q = int(readline())
	for i in range(q):
		(xi, yi) = map(int, readline().split())
		pi = xi + yi * 1j
		cross = p1 + (p2 - p1) * projecter(p2 - p1, pi - p1)
		cross = cross * 2 - pi
		print('{:.10f} {:.10f}'.format(cross.real, cross.imag))

def projecter(a, b):
	return dot(a, b) / dot(a, a)

def dot(a, b):
	return a.real * b.real + a.imag * b.imag
main()


import math

class Point:

	def __init__(self, x=None, y=None):
		self.x = x
		self.y = y

class Line:

	def __init__(self, x1, y1, x2, y2):
		self.p1 = Point(x1, y1)
		self.p2 = Point(x2, y2)

	def projection(self, p):
		a = (self.p2.y - self.p1.y) / (self.p2.x - self.p1.x) if self.p2.x != self.p1.x else float('inf')
		if a == 0:
			return (p.x, 2 * self.p1.y - p.y)
		elif a == float('inf'):
			return (2 * self.p1.x - p.x, p.y)
		else:
			b = self.p2.y - a * self.p2.x
			d = abs(-1 * a * p.x + p.y - b) / math.sqrt(1 + a * a)
			ans_y = [p.y + math.sqrt(4 * d * d / (a * a + 1)), p.y - math.sqrt(4 * d * d / (a * a + 1))]
			ans_x = [p.x - a * (_y - p.y) for _y in ans_y]
			(rst_x, rst_y) = (None, None)
			tmp = abs(-1 * a * ans_x[0] + ans_y[0] - b) / math.sqrt(1 + a * a) - d
			if tmp < abs(-1 * a * ans_x[1] + ans_y[1] - b) / math.sqrt(1 + a * a) - d:
				(rst_x, rst_y) = (ans_x[0], ans_y[0])
			else:
				(rst_x, rst_y) = (ans_x[1], ans_y[1])
			return (round(rst_x, 9), round(rst_y, 9))
(x1, y1, x2, y2) = list(map(int, input().split(' ')))
line = Line(x1, y1, x2, y2)
q = int(input())
for i in range(q):
	(x, y) = list(map(int, input().split(' ')))
	p = Point(x, y)
	(rst_x, rst_y) = line.projection(p)
	print(rst_x, rst_y)


EPS = 1e-10

class Point:
	global EPS

	def __init__(self, x=0, y=0):
		self.x = x
		self.y = y

	def __add__(a, b):
		s = a.x + b.x
		t = a.y + b.y
		return Point(s, t)

	def __sub__(a, b):
		s = a.x - b.x
		t = a.y - b.y
		return Point(s, t)

	def __mul__(self, a):
		s = a * self.x
		t = a * self.y
		return Point(s, t)

	def __truediv__(self, a):
		s = self.x / a
		t = self.y / a
		return Point(s, t)

	def norm(self):
		return self.x * self.x + self.y * self.y

	def abs(self):
		return self.norm() ** 0.5

	def __eq__(self, other):
		return abs(self.x - other.y) < self.EPS and abs(self.y - other.y) < self.EPS

	def dot(self, b):
		return self.x * b.x + self.y * b.y

	def cross(self, b):
		return self.x * b.y - self.y * b.x

class Segment:

	def __init__(self, p1, p2):
		self.p1 = p1
		self.p2 = p2

def project(s, p):
	base = s.p2 - s.p1
	hypo = p - s.p1
	r = hypo.dot(base) / base.norm()
	return s.p1 + base * r

def reflecton(s, p):
	return p + (project(s, p) - p) * 2
nums = list(map(int, input().split()))
s = Segment(Point(nums[0], nums[1]), Point(nums[2], nums[3]))
n = int(input())
for i in range(n):
	nums = list(map(int, input().split()))
	p = Point(nums[0], nums[1])
	x = reflecton(s, p)
	print(x.x, x.y)


(a, b, c, d) = map(float, input().split())
a = complex(a, b)
b = complex(c, d)
for _ in [0] * int(input()):
	c = complex(*map(float, input().split()))
	q = b - a
	c -= a
	p = a + q * (c / q).conjugate()
	print(p.real, p.imag)


from math import hypot
(x1, y1, x2, y2) = map(int, input().split())
(dx, dy) = (x2 - x1, y2 - y1)
vector_base = hypot(dx, dy)
q = int(input())
for i in range(q):
	(x3, y3) = map(int, input().split())
	r = ((x3 - x1) * dx + (y3 - y1) * dy) / vector_base ** 2
	(tx, ty) = (x1 + dx * r, y1 + dy * r)
	print('{:.08f}'.format(x3 + 2 * (tx - x3)), '{:.08f}'.format(y3 + 2 * (ty - y3)))


(x_p1, y_p1, x_p2, y_p2) = map(lambda x: int(x), input().split())
q = int(input())
p1p2 = (x_p2 - x_p1, y_p2 - y_p1)
for _ in range(q):
	(x_p0, y_p0) = map(lambda x: int(x), input().split())
	p1p0 = (x_p0 - x_p1, y_p0 - y_p1)
	r = (p1p2[0] * p1p0[0] + p1p2[1] * p1p0[1]) / (p1p2[0] ** 2 + p1p2[1] ** 2)
	proj_p = (x_p1 + p1p2[0] * r, y_p1 + p1p2[1] * r)
	proj_v = (proj_p[0] - x_p0, proj_p[1] - y_p0)
	print(x_p0 + 2 * proj_v[0], y_p0 + 2 * proj_v[1])


def dot(a, b):
	return a[0] * b[0] + a[1] * b[1]
(x1, y1, x2, y2) = [int(i) for i in input().split()]
q = int(input())
for i in range(q):
	(x, y) = [int(i) for i in input().split()]
	a = [x2 - x1, y2 - y1]
	b = [x - x1, y - y1]
	co = dot(a, b) / dot(a, a)
	isec = [co * a[0] + x1, co * a[1] + y1]
	c = [isec[0] - x, isec[1] - y]
	print(isec[0] + c[0], isec[1] + c[1])


import sys

def solve(_prj_info):
	for point in _prj_info:
		(xp, yp) = map(int, point)
		p = xp + yp * 1j
		hypo = p - p1
		prj = p1 + base * project(base, hypo)
		ref = p + (prj - p) * 2.0
		print('{0:.10f} {1:.10f}'.format(ref.real, ref.imag))
	return _prj_info

def dot(a, b):
	return a.real * b.real + a.imag * b.imag

def project(a, b):
	return dot(a, b) / dot(a, a)
_input = sys.stdin.readlines()
base_info = _input[0].split()
q_num = int(_input[1])
prj_points = map(lambda x: x.split(), _input[2:])
(x1, y1, x2, y2) = map(int, base_info)
(p1, p2) = (x1 + y1 * 1j, x2 + y2 * 1j)
base = p2 - p1
res = solve(prj_points)


import sys
input = sys.stdin.readline
from math import cos, sin, radians, sqrt

def Reflection(p1, p2):
	(x, y) = p2
	(tx, ty) = Projection(p1, (x, y))
	rx = (tx - x) * 2 + x
	ry = (ty - y) * 2 + y
	return (rx, ry)

def Projection(p1, p2):
	(x1, y1, x2, y2) = p1
	if x1 * x1 + y1 * y1 > x2 * x2 + y2 * y2:
		(x1, y1, x2, y2) = (x2, y2, x1, y1)
	(x3, y3) = p2
	tx = x2 - x1
	ty = y2 - y1
	l = sqrt(tx * tx + ty * ty)
	nx = tx / l
	ny = ty / l
	pl = nx * (x3 - x1) + ny * (y3 - y1)
	return (nx * pl + x1, ny * pl + y1)

def main():
	(x1, y1, x2, y2) = map(int, input().split())
	for i in range(int(input())):
		(x3, y3) = map(int, input().split())
		print('{:.10f} {:.10f}'.format(*Reflection((x1, y1, x2, y2), (x3, y3))))
main()


from math import sin, cos, atan2

def sgn(x, eps=1e-10):
	if x < -eps:
		return -1
	if -eps <= x <= eps:
		return 0
	if eps < x:
		return 1

class Vector:

	def __init__(self, x=0.0, y=0.0):
		self.x = x
		self.y = y

	def arg(self):
		return atan2(self.y, self.x)

	def norm(self):
		return (self.x ** 2 + self.y ** 2) ** 0.5

	def rotate(self, t):
		nx = self.x * cos(t) - self.y * sin(t)
		ny = self.x * sin(t) + self.y * cos(t)
		return Vector(nx, ny)

	def counter(self):
		nx = -self.x
		ny = -self.y
		return Vector(nx, ny)

	def times(self, k):
		nx = self.x * k
		ny = self.y * k
		return Vector(nx, ny)

	def unit(self):
		norm = self.norm()
		nx = self.x / norm
		ny = self.y / norm
		return Vector(nx, ny)

	def normal(self):
		norm = self.norm()
		nx = -self.y / norm
		ny = self.x / norm
		return Vector(nx, ny)

	def add(self, other):
		nx = self.x + other.x
		ny = self.y + other.y
		return Vector(nx, ny)

	def sub(self, other):
		nx = self.x - other.x
		ny = self.y - other.y
		return Vector(nx, ny)

	def dot(self, other):
		return self.x * other.x + self.y * other.y

	def cross(self, other):
		return self.x * other.y - self.y * other.x

	def __str__(self):
		return '{:.9f}'.format(self.x) + ' ' + '{:.9f}'.format(self.y)

class Line:

	def __init__(self, bgn=Vector(), end=Vector()):
		self.bgn = bgn
		self.end = end

	def build(self, a, b, c):
		assert sgn(a) != 0 or sgn(b) != 0
		if sgn(b) == 0:
			self.bgn = Vector(-c / a, 0.0)
			self.end = Vector(-c / a, 1.0)
		else:
			self.v = Vector(0, -c / b)
			self.u = Vector(1.0, -(a + b) / b)

	def vec(self):
		return self.end.sub(self.bgn)

	def projection(self, point):
		v = self.vec()
		u = point.sub(self.bgn)
		k = v.dot(u) / v.norm()
		h = v.unit().times(k)
		return self.bgn.add(h)

	def refrection(self, point):
		proj = self.projection(point)
		return proj.sub(point).times(2).add(point)
(xp1, yp1, xp2, yp2) = map(int, input().split())
q = int(input())
p1 = Vector(xp1, yp1)
p2 = Vector(xp2, yp2)
l = Line(p1, p2)
for _ in range(q):
	(x, y) = map(int, input().split())
	p = Vector(x, y)
	ref = l.refrection(p)
	print(ref)


import math

class Point:

	def __init__(self, x, y):
		self.x = x
		self.y = y

	def __add__(self, a):
		return self.__class__(self.x + a.x, self.y + a.y)

	def __sub__(self, a):
		return self.__class__(self.x - a.x, self.y - a.y)

	def __mul__(self, d):
		return self.__class__(self.x * d, self.y * d)

	def __truediv__(self, d):
		return self.__class__(self.x / d, self.y / d)

	def __str__(self):
		return '%.10f %.10f' % (self.x, self.y)

	def abs(self):
		return self.norm() ** (1.0 / 2.0)

	def norm(self):
		return self.x * self.x + self.y * self.y

	def rotate(self, d):
		r = math.pi * d / 180.0
		return self.__class__(self.x * math.cos(r) - self.y * math.sin(r), self.x * math.sin(r) + self.y * math.cos(r))

	def dot(self, p):
		return self.x * p.x + self.y * p.y

class Segment:

	def __init__(self, p1, p2):
		self.p1 = p1
		self.p2 = p2

def project(s, p):
	v = s.p2 - s.p1
	r = v.dot(p - s.p1) / v.norm()
	return s.p1 + v * r

def reflect(s, p):
	return p + (project(s, p) - p) * 2.0

def main():
	(a, b, c, d) = map(float, input().split())
	s = Segment(Point(a, b), Point(c, d))
	q = int(input())
	for _ in range(q):
		(e, f) = map(float, input().split())
		p = Point(e, f)
		print(reflect(s, p))
main()


import math

class Point:
	EPS = 1 << 10

	def __init__(self, x, y):
		self.x = x
		self.y = y

	def __add__(self, other):
		return Point(self.x + other.x, self.y + other.y)

	def __sub__(self, other):
		return Point(self.x - other.x, self.y - other.y)

	def __mul__(self, other):
		return Point(self.x * other, self.y * other)

	def __floordiv__(self, other):
		return Point(self.x / other.x, self.y / other.y)

	def __abs__(self):
		return math.sqrt(self.norm())

	def norm(self):
		return self.x ** 2 + self.y ** 2

	def __eq__(self, other):
		EPS = self.__class__.EPS
		return abs(self.x - other.x) < EPS and abs(self.x - other.x) < EPS

	def dot(self, other):
		return self.x * other.x + self.y * other.y

	def cross(self, other):
		return self.x * other.y - self.y * other.x

	def isOrthogonal(self, a, b):
		return a.dot(b) == 0.0

	def isParallel(self, a, b):
		return a.cross(b) == 0.0

	def __str__(self):
		return str(self.x) + ' ' + str(self.y)

class Vector(Point):
	pass

class Segment:

	def __init__(self, p1, p2):
		self.p1 = p1
		self.p2 = p2

	def isOrthogonal(s1, s2):
		return (s1.p2 - s1.p1).dot(s2.p2 - s2.p1) == 0.0

	def isParallel(s1, s2):
		return (s1.p2 - s1.p1).cross(s2.p2 - s2.p1) == 0.0

class Line(Segment):
	pass

class Circle:

	def __init__(self, c, r):
		self.c = c
		self.r = r

class Polygon:

	def __init__(self, *points):
		self.points = points

def reflect(s, p):
	m = project(s, p)
	return (m - p) * 2 + p

def project(s, p):
	base = s.p2 - s.p1
	r = (p - s.p1).dot(base) / base.norm()
	return s.p1 + base * r
(x1, y1, x2, y2) = map(int, input().split())
(p1, p2) = (Point(x1, y1), Point(x2, y2))
s = Segment(p1, p2)
q = int(input())
for i in range(q):
	p = Point(*map(int, input().split()))
	print(reflect(s, p))


(xp1, yp1, xp2, yp2) = map(int, input().split())
q = int(input())
r = [xp2 - xp1, yp2 - yp1]

def a(p1, p2):
	s = (p1 - xp1, p2 - yp1)
	d = r[0] * s[0] + r[1] * s[1]
	a = xp1 + r[0] * d / (r[0] ** 2 + r[1] ** 2)
	b = yp1 + r[1] * d / (r[0] ** 2 + r[1] ** 2)
	return (a, b)
for i in range(q):
	(x, y) = map(int, input().split())
	(x2, y2) = a(x, y)
	print(x + 2 * (x2 - x), y + 2 * (y2 - y))


def dot(a, b):
	return a.real * b.real + a.imag * b.imag
(x1, y1, x2, y2) = map(int, input().split())
p1 = x1 + y1 * 1j
p2 = x2 + y2 * 1j
l = p2 - p1
l_norm = dot(l, l)
q = int(input())
for (x3, y3) in (map(int, input().split()) for _ in [0] * q):
	p3 = x3 + y3 * 1j
	a = p3 - p1
	k = dot(a, l) / l_norm
	projection_vector = k * l
	reflect_vector = projection_vector - a
	print(x3 + 2 * reflect_vector.real, y3 + 2 * reflect_vector.imag)


class Vector:

	def __init__(self, x, y):
		self.x = x
		self.y = y

	def is_orthogonal(self, v):
		if self.x * v.x + self.y * v.y == 0:
			return True
		else:
			return False

	def is_parallel(self, v):
		if self.x * v.y - self.y * v.x == 0:
			return True
		else:
			return False

	def dot_product(self, v):
		return self.x * v.x + self.y * v.y

	def quadrance(self):
		return self.x ** 2 + self.y ** 2

	def mul(self, k):
		return Vector(self.x * k, self.y * k)

	def __add__(self, v):
		return Vector(self.x + v.x, self.y + v.y)

	def __sub__(self, v):
		return Vector(self.x - v.x, self.y - v.y)

	def __str__(self):
		return '{0:.8f} {1:.8f}'.format(self.x, self.y)

	def projection_on(self, v):
		return v.mul(self.dot_product(v) / v.quadrance())

	def rejection_from(self, v):
		return self - self.projection_on(v)
import sys
file_input = sys.stdin
(x_p1, y_p1, x_p2, y_p2) = map(int, file_input.readline().split())
p1_p2 = Vector(x_p2 - x_p1, y_p2 - y_p1)
q = int(file_input.readline())
for line in file_input:
	(x_p, y_p) = map(int, line.split())
	p1_p = Vector(x_p - x_p1, y_p - y_p1)
	r_v = p1_p.rejection_from(p1_p2)
	o_p = Vector(x_p, y_p)
	print(o_p - r_v.mul(2))


import math

class Vector:

	def __init__(self, x, y):
		self.x = x
		self.y = y

	def norm_2(self):
		return dot(self, self)

	def norm(self):
		return math.sqrt(self.norm_2())

def v_sum(v1, v2):
	return Vector(v1.x + v2.x, v1.y + v2.y)

def scalar_multi(k, v):
	return Vector(k * v.x, k * v.y)

def v_diff(v1, v2):
	return v_sum(v1, scalar_multi(-1, v2))

def dot(vector1, vector2):
	return vector1.x * vector2.x + vector1.y * vector2.y

def cross(vector1, vector2):
	return vector1.x * vector2.y + vector1.y * vector2.x
(x1, y1, x2, y2) = map(int, input().split())
p1 = Vector(x1, y1)
p2 = Vector(x2, y2)
d = v_diff(p2, p1)
q = int(input())
for i in range(q):
	(x, y) = map(int, input().split())
	v = v_diff(Vector(x, y), p1)
	h = scalar_multi(dot(v, d) / d.norm_2(), d)
	w = v_sum(scalar_multi(2, v_diff(h, v)), v)
	print('{} {}'.format(v_sum(w, p1).x, v_sum(w, p1).y))


def project(x, y):
	base = [x2 - x1, y2 - y1]
	hypo = [x - x1, y - y1]
	r = (base[0] * hypo[0] + base[1] * hypo[1]) / (base[0] ** 2 + base[1] ** 2)
	return (x1 + base[0] * r, y1 + base[1] * r)

def reflect(x, y):
	(px, py) = project(x, y)
	return (x + (px - x) * 2, y + (py - y) * 2)
(x1, y1, x2, y2) = map(int, input().split())
q = int(input())
for i in range(q):
	(x, y) = map(int, input().split())
	print(*reflect(x, y))


import sys
from itertools import starmap
readline = sys.stdin.readline

class Segment(object):
	__slots__ = ('fi', 'se')

	def __init__(self, fi, se):
		self.fi = fi
		self.se = se

def cross(a, b):
	return a.real * b.imag - a.imag * b.real

def dot(a, b):
	return a.real * b.real + a.imag * b.imag

def norm(base):
	return abs(base) ** 2

def project(s, p2):
	base = s.fi - s.se
	r = dot(p2 - s.fi, base) / norm(base)
	return s.fi + base * r

def reflect(s, p):
	return p + (project(s, p) - p) * 2.0
s = Segment(*starmap(complex, zip(*[map(int, readline().split())] * 2)))
n = int(readline())
for _ in [0] * n:
	p1 = reflect(s, complex(*map(float, readline().split())))
	print('{0:.10f} {1:.10f}'.format(p1.real, p1.imag))


def LI():
	return list(map(int, input().split()))

def II():
	return int(input())

def LS():
	return input().split()

def S():
	return input()

def LIR(n):
	return [LI() for i in range(n)]

def MI():
	return map(int, input().split())
(p1x, p1y, c, d) = MI()
q = II()
if p1x == c:
	f = 0
elif p1y == d:
	f = 1
else:
	f = 2
	m = (d - p1y) / (c - p1x)
for _ in range(q):
	(px, py) = MI()
	if not f:
		a = 2 * p1x - px
		b = py
	elif f == 1:
		a = px
		b = 2 * p1y - py
	else:
		a = (2 * py + (1 / m - m) * px + 2 * m * p1x - 2 * p1y) / (m + 1 / m)
		b = -1 / m * (a - px) + py
	print(a, b)


(xp1, yp1, xp2, yp2) = map(int, input().split())
q = int(input())
if xp1 == xp2:
	for i in range(q):
		(x0, y0) = map(int, input().split())
		print('{:.10f}'.format(2 * xp1 - x0), '{:.10f}'.format(y0))
else:
	a = float((yp2 - yp1) / (xp2 - xp1))
	for i in range(q):
		(x0, y0) = map(int, input().split())
		x = a * (y0 - yp1 - a * (x0 - xp1)) / (1 + a ** 2) + x0
		y = (a * (a * y0 + x0 - xp1) + yp1) / (1 + a ** 2)
		print('{:.10f}'.format(2 * x - x0), '{:.10f}'.format(2 * y - y0))


import collections
import math

class Vector2(collections.namedtuple('Vector2', ['x', 'y'])):

	def __add__(self, other):
		return Vector2(self.x + other.x, self.y + other.y)

	def __sub__(self, other):
		return Vector2(self.x - other.x, self.y - other.y)

	def __mul__(self, scalar):
		return Vector2(self.x * scalar, self.y * scalar)

	def __neg__(self):
		return Vector2(-self.x, -self.y)

	def __pos__(self):
		return Vector2(+self.x, +self.y)

	def __abs__(self):
		return math.sqrt(float(self.x * self.x + self.y * self.y))

	def dot(self, other):
		return self.x * other.x + self.y * other.y

	def cross(self, other):
		return self.x * other.y - self.y * other.x
(a, b, c, d) = map(int, input().split())
p1 = Vector2(a, b)
p2 = Vector2(c, d)
base = p2 - p1
q = int(input())
ans = []
for _ in range(q):
	(e, f) = map(int, input().split())
	p = Vector2(e, f)
	hypo = Vector2(e - a, f - b)
	proj = p1 + base * (hypo.dot(base) / float(base.x ** 2 + base.y ** 2))
	x = p + (proj - p) * 2
	ans.append(x)
for x in ans:
	print(x.x, x.y)


(x0, y0, x1, y1) = map(float, input().split())
n = int(input())
(vx1, vy1) = (x1 - x0, y1 - y0)
for i in range(n):
	(x2, y2) = map(float, input().split())
	(vx2, vy2) = (x2 - x0, y2 - y0)
	sqr = vx1 ** 2 + vy1 ** 2
	in_p = vx1 * vx2 + vy1 * vy2
	(xt, yt) = (2 * in_p * vx1 / sqr + 2 * x0 - x2, 2 * in_p * vy1 / sqr + 2 * y0 - y2)
	print('{0:.10f} {1:.10f}'.format(xt, yt))


from collections import defaultdict, deque
import sys, heapq, bisect, math, itertools, string, queue
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
mod = 10 ** 9 + 7
eps = 10 ** (-7)

def inp():
	return int(input())

def inpl():
	return list(map(int, input().split()))

def inpl_str():
	return list(input().split())

def sgn(a):
	if a < -eps:
		return -1
	if a > eps:
		return 1
	return 0

class Point:

	def __init__(self, x, y):
		self.x = x
		self.y = y
		pass

	def tolist(self):
		return [self.x, self.y]

	def __add__(self, p):
		return Point(self.x + p.x, self.y + p.y)

	def __iadd__(self, p):
		return self + p

	def __sub__(self, p):
		return Point(self.x - p.x, self.y - p.y)

	def __isub__(self, p):
		return self - p

	def __truediv__(self, n):
		return Point(self.x / n, self.y / n)

	def __itruediv__(self, n):
		return self / n

	def __mul__(self, n):
		return Point(self.x * n, self.y * n)

	def __imul__(self, n):
		return self * n

	def __lt__(self, other):
		tmp = sgn(self.x - other.x)
		if tmp != 0:
			return tmp < 0
		else:
			return sgn(self.y - other.y) < 0

	def abs(self):
		return math.sqrt(self.x ** 2 + self.y ** 2)

	def dot(self, p):
		return self.x * p.x + self.y * p.y

	def det(self, p):
		return self.x * p.y - self.y * p.x

	def arg(self, p):
		return math.atan2(y, x)

def iSP(a, b, c):
	tmp = sgn((b - a).det(c - a))
	if tmp > 0:
		return 1
	elif tmp < 0:
		return -1
	else:
		if sgn((b - a).dot(c - a)) < 0:
			return -2
		if sgn((a - b).dot(c - b)) < 0:
			return 2
		return 0

def isToleranceLine(a, b, c, d):
	if sgn((b - a).det(c - d)) != 0:
		return 1
	elif sgn((b - a).det(c - a)) != 0:
		return 0
	else:
		return -1

def isToleranceSegline(a, b, c, d):
	return sgn(iSP(a, b, c) * iSP(a, b, d)) <= 0 and sgn(iSP(c, d, a) * iSP(c, d, b)) <= 0

def Intersection(a, b, c, d):
	tmp1 = (b - a) * (c - a).det(d - c)
	tmp2 = (b - a).det(d - c)
	return a + tmp1 / tmp2

def DistanceLineToPoint(a, b, c):
	return abs((c - a).det(b - a) / (b - a).abs())

def DistanceSeglineToPoint(a, b, c):
	if sgn((b - a).dot(c - a)) < 0:
		return (c - a).abs()
	if sgn((a - b).dot(c - b)) < 0:
		return (c - b).abs()
	return DistanceLineToPoint(a, b, c)

def Vfoot(a, b, c):
	d = c + Point((b - a).y, -(b - a).x)
	return Intersection(a, b, c, d)

def PolygonArea(Plist):
	Plist = ConvexHull(Plist)
	L = len(Plist)
	S = 0
	for i in range(L):
		tmpS = Plist[i - 1].det(Plist[i]) / 2
		S += tmpS
	return S

def PolygonG(Plist):
	Plist = ConvexHull(Plist)
	L = len(Plist)
	S = 0
	G = Point(0, 0)
	for i in range(L):
		tmpS = Plist[i - 1].det(Plist[i]) / 2
		S += tmpS
		G += (Plist[i - 1] + Plist[i]) / 3 * tmpS
	return G / S

def ConvexHull(Plist):
	Plist.sort()
	L = len(Plist)
	qu = deque([])
	quL = 0
	for p in Plist:
		while quL >= 2 and iSP(qu[quL - 2], qu[quL - 1], p) == 1:
			qu.pop()
			quL -= 1
		qu.append(p)
		quL += 1
	qd = deque([])
	qdL = 0
	for p in Plist:
		while qdL >= 2 and iSP(qd[qdL - 2], qd[qdL - 1], p) == -1:
			qd.pop()
			qdL -= 1
		qd.append(p)
		qdL += 1
	qd.pop()
	qu.popleft()
	hidari = list(qd) + list(reversed(qu))
	return hidari
(x1, y1, x2, y2) = inpl()
(a, b) = (Point(x1, y1), Point(x2, y2))
q = inp()
for _ in range(q):
	p = Point(*inpl())
	q = Vfoot(a, b, p)
	q += q - p
	print(*q.tolist())


L1 = input().split()
[xp1, yp1, xp2, yp2] = [int(L1[0]), int(L1[1]), int(L1[2]), int(L1[3])]
direction = [xp2 - xp1, yp2 - yp1]
norm_direc = [(xp2 - xp1) / ((xp2 - xp1) ** 2 + (yp2 - yp1) ** 2) ** (1 / 2), (yp2 - yp1) / ((xp2 - xp1) ** 2 + (yp2 - yp1) ** 2) ** (1 / 2)]
q = int(input())
L = []
for i in range(q):
	L2 = input().split()
	L.append([int(L2[0]), int(L2[1])])
Point = []
for i in range(q):
	Point.append([L[i][0] - xp1, L[i][1] - yp1])
Vec = []
for i in range(q):
	Vec.append([L[i][0] - xp1, L[i][1] - yp1])
Proj = []
for i in range(q):
	inter = Vec[i][0] * norm_direc[0] + Vec[i][1] * norm_direc[1]
	Proj.append([norm_direc[0] * inter, norm_direc[1] * inter])
vert = []
for i in range(q):
	vert.append([Vec[i][0] - Proj[i][0], Vec[i][1] - Proj[i][1]])
L3 = []
for i in range(q):
	a = L[i][0] - 2 * vert[i][0]
	b = L[i][1] - 2 * vert[i][1]
	if -1e-08 < a < 1e-08:
		a = 0
	if -1e-08 < b < 1e-08:
		b = 0
	L3.append([a, b])
for i in range(q):
	print(*L3[i])


from typing import List
from math import sqrt
EPS = 1e-10

def float_equal(x: float, y: float) -> bool:
	return abs(x - y) < EPS

class Point:

	def __init__(self, x: float=0.0, y: float=0.0) -> None:
		self.x = x
		self.y = y

	def __repr__(self) -> str:
		return 'Point({}, {})'.format(self.x, self.y)

	def __eq__(self, other: object) -> bool:
		if not isinstance(other, Point):
			return NotImplemented
		return float_equal(self.x, other.x) and float_equal(self.y, other.y)

	def __add__(self, other: 'Point') -> 'Point':
		return Point(self.x + other.x, self.y + other.y)

	def __sub__(self, other: 'Point') -> 'Point':
		return Point(self.x - other.x, self.y - other.y)

	def __mul__(self, k: float) -> 'Point':
		return Point(self.x * k, self.y * k)

	def __rmul__(self, k: float) -> 'Point':
		return self * k

	def __truediv__(self, k: float) -> 'Point':
		return Point(self.x / k, self.y / k)

	def __lt__(self, other: 'Point') -> bool:
		return self.y < other.y if abs(self.x - other.x) < EPS else self.x < other.x

	def norm(self):
		return self.x * self.x + self.y * self.y

	def abs(self):
		return sqrt(self.norm())

	def dot(self, other: 'Point') -> float:
		return self.x * other.x + self.y * other.y

	def cross(self, other: 'Point') -> float:
		return self.x * other.y - self.y * other.x

	def is_orthogonal(self, other: 'Point') -> bool:
		return float_equal(self.dot(other), 0.0)

	def is_parallel(self, other: 'Point') -> bool:
		return float_equal(self.cross(other), 0.0)
Vector = Point

class Segment:

	def __init__(self, p1: Point=None, p2: Point=None) -> None:
		self.p1: Point = Point() if p1 is None else p1
		self.p2: Point = Point() if p2 is None else p2

	def __repr__(self) -> str:
		return 'Segment({}, {})'.format(self.p1, self.p2)

	def __eq__(self, other: object) -> bool:
		if not isinstance(other, Segment):
			return NotImplemented
		return self.p1 == other.p1 and self.p2 == other.p2

	def vector(self) -> Vector:
		return self.p2 - self.p1

	def is_orthogonal(self, other: 'Segment') -> bool:
		return self.vector().is_orthogonal(other.vector())

	def is_parallel(self, other: 'Segment') -> bool:
		return self.vector().is_parallel(other.vector())

	def projection(self, p: Point) -> Point:
		v = self.vector()
		vp = p - self.p1
		return v.dot(vp) / v.norm() * v + self.p1

	def reflection(self, p: Point) -> Point:
		x = self.projection(p)
		return p + 2 * (x - p)
Line = Segment

class Circle:

	def __init__(self, c: Point=None, r: float=0.0) -> None:
		self.c: Point = Point() if c is None else c
		self.r: float = r

	def __eq__(self, other: object) -> bool:
		if not isinstance(other, Circle):
			return NotImplemented
		return self.c == other.c and self.r == other.r

	def __repr__(self) -> str:
		return 'Circle({}, {})'.format(self.c, self.r)

def main() -> None:
	(x1, y1, x2, y2) = [int(x) for x in input().split()]
	p1 = Point(x1, y1)
	p2 = Point(x2, y2)
	l = Line(p1, p2)
	q = int(input())
	for _ in range(q):
		(x, y) = [int(x) for x in input().split()]
		p = Point(x, y)
		a = l.reflection(p)
		print(a.x, a.y)
main()


import cmath
import os
import sys
if os.getenv('LOCAL'):
	sys.stdin = open('_in.txt', 'r')
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
IINF = 10 ** 18
MOD = 10 ** 9 + 7
PI = cmath.pi
TAU = cmath.pi * 2

class Point:
	EPS = 1e-09

	def __init__(self, c: complex):
		self.c = c

	@property
	def x(self):
		return self.c.real

	@property
	def y(self):
		return self.c.imag

	@staticmethod
	def from_rect(x: float, y: float):
		return Point(complex(x, y))

	@staticmethod
	def from_polar(r: float, phi: float):
		return Point(cmath.rect(r, phi))

	def __add__(self, p):
		return Point(self.c + p.c)

	def __iadd__(self, p):
		self.c += p.c
		return self

	def __sub__(self, p):
		return Point(self.c - p.c)

	def __isub__(self, p):
		self.c -= p.c
		return self

	def __mul__(self, f: float):
		return Point(self.c * f)

	def __imul__(self, f: float):
		self.c *= f
		return self

	def __truediv__(self, f: float):
		return Point(self.c / f)

	def __itruediv__(self, f: float):
		self.c /= f
		return self

	def __repr__(self):
		return '({}, {})'.format(round(self.x, 10), round(self.y, 10))

	def __neg__(self):
		return Point(-self.c)

	def __eq__(self, p):
		return abs(self.c - p.c) < self.EPS

	def __abs__(self):
		return abs(self.c)

	def dot(self, p):
		return self.x * p.x + self.y * p.y

	def det(self, p):
		return self.x * p.y - self.y * p.x

	def dist(self, p):
		return abs(self.c - p.c)

	def r(self):
		return abs(self.c)

	def phase(self):
		return cmath.phase(self.c)

	def angle(self, p, q):
		return (cmath.phase(q.c - self.c) - cmath.phase(p.c - self.c)) % TAU

	def area(self, p, q):
		return abs((p - self).det(q - self) / 2)

	def projection_point(self, p, q, allow_outer=False):
		diff_q = q - p
		r = (self - p).dot(diff_q) / abs(diff_q)
		phase = diff_q.phase()
		ret = Point.from_polar(r, phase) + p
		if allow_outer or (p - ret).dot(q - ret) < self.EPS:
			return ret
		return None

	def reflection_point(self, p, q):
		r = abs(self - p)
		angle = p.angle(q, self)
		angle = (q - p).phase() - angle
		return Point.from_polar(r, angle) + p

	def on_segment(self, p, q):
		return abs((p - self).det(q - self)) < self.EPS and (p - self).dot(q - self) < self.EPS
(p1x, p1y, p2x, p2y) = list(map(float, sys.stdin.buffer.readline().split()))
Q = int(sys.stdin.buffer.readline())
XY = [list(map(float, sys.stdin.buffer.readline().split())) for _ in range(Q)]
p1 = Point.from_rect(p1x, p1y)
p2 = Point.from_rect(p2x, p2y)
for (x, y) in XY:
	p = Point.from_rect(x, y)
	ans = p.reflection_point(p1, p2)
	print('{:.10f} {:.10f}'.format(ans.x, ans.y))


class Vector:
	__slots__ = ['x', 'y']

	def __init__(self, x, y):
		(self.x, self.y) = (x, y)

	def __add__(self, other):
		return self.__class__(self.x + other.x, self.y + other.y)

	def __sub__(self, other):
		return self.__class__(self.x - other.x, self.y - other.y)

	def __mul__(self, x):
		return self.__class__(self.x * x, self.y * x)

	def __truediv__(self, x):
		return self.__class__(self.x / x, self.y / x)

	def norm(self):
		return (self.x ** 2 + self.y ** 2) ** 0.5

def dot(u, v):
	return u.x * v.x + u.y * v.y
(x1, y1, x2, y2) = map(float, input().split())
(p1, p2) = (Vector(x1, y1), Vector(x2, y2))
n = (p2 - p1) / (p2 - p1).norm()
q = int(input())
for _ in range(q):
	p = Vector(*map(float, input().split()))
	p_prj = p1 + n * dot(p - p1, n)
	p_ref = p_prj * 2 - p
	print('{:.10f} {:.10f}'.format(p_ref.x, p_ref.y))


import math

class Vector2:

	def __init__(self, x, y):
		self.x = x
		self.y = y

	def __add__(self, v):
		return Vector2(self.x + v.x, self.y + v.y)

	def __sub__(self, v):
		return Vector2(self.x - v.x, self.y - v.y)

	def __mul__(self, v):
		return Vector2(self.x * v, self.y * v)

	def __truediv__(self, v):
		return Vector2(self.x / v, self.y / v)

	def __abs__(self):
		return math.sqrt(float(self.x * self.x + self.y * self.y))

	def dot(self, v):
		return self.x * v.x + self.y * v.y

	def cross(self, v):
		return self.x * v.y - self.y * v.x

	def norm(self):
		d = abs(self)
		return Vector2(self.x / d, self.y / d)
(x1, y1, x2, y2) = map(int, input().split())
v12 = Vector2(x2 - x1, y2 - y1).norm()
q = int(input())
for i in range(q):
	(x, y) = map(int, input().split())
	v = Vector2(x - x1, y - y1)
	d = v12.dot(v)
	a = Vector2(x1 + v12.x * d, y1 + v12.y * d)
	p = Vector2(x, y)
	b = p + (a - p) * 2.0
	print(f'{b.x:.9f} {b.y:.9f}')