Read a set of coordinates of three different points P1 (x1, y1), P2 (x2, y2), Q (xq, yq) on the plane, and line symmetry with point Q with the straight line passing through point P1 point P2 as the axis of symmetry. Create a program that outputs the point R (x, y) at the position of. Note that the point Q is not on its axis of symmetry.

<image>



input

The input consists of multiple datasets. Each dataset is given in the following format:


x1, y1, x2, y2, xq, yq


x1, y1, x2, y2, xq, yq (real numbers between -100 and 100) are given on one line separated by commas.

The number of datasets does not exceed 50.

output

Print x, y on a single line, separated by blanks, for each dataset. The output may contain an error of 0.0001 or less in real numbers.

Example

Input

1.0,0.0,-1.0,0.0,1.0,1.0
1.0,0.0,0.0,-1.0,3.0,0.0
0.0,1.0,0.0,-1.0,1.0,1.0


Output

1.000000 -1.000000
1.000000 2.000000
-1.000000 1.000000

Difficulty: UNKNOWN_DIFFICULTY

Starter code:

Solutions:
import math

def get_input():
	while True:
		try:
			yield ''.join(input())
		except EOFError:
			break
N = list(get_input())
for l in range(len(N)):
	(x1, y1, x2, y2, xq, yq) = [float(i) for i in N[l].split(',')]
	a = y2 - y1
	b = x1 - x2
	c = y1 * (x2 - x1) - x1 * (y2 - y1)
	p = a
	q = b
	A = -a * xq - b * yq - 2 * c
	r = x2 - x1
	s = y2 - y1
	B = xq * (x2 - x1) + yq * (y2 - y1)
	X = (A * s - B * q) / (p * s - r * q)
	Y = (-A * r + B * p) / (p * s - r * q)
	print(X, Y)


import sys
from math import *
for e in sys.stdin:
	(a, b, c, d, x, y) = map(float, e.split(','))
	g = 2 * atan2(d - b, c - a)
	(s, t) = (sin(g), cos(g))
	x -= a
	y -= b
	print(f'{t * x + s * y + a:.6f} {s * x - t * y + b:.6f}')


import sys
from math import *
for e in sys.stdin:
	(a, b, c, d, x, y) = map(float, e.split(','))
	g = -2 * (atan2(y - b, x - a) - atan2(d - b, c - a))
	(s, t) = (sin(g), cos(g))
	x -= a
	y -= b
	print(f'{t * x - s * y + a:.6f} {s * x + t * y + b:.6f}')


while True:
	try:
		(x1, y1, x2, y2, xq, yq) = map(float, input().split(','))
	except EOFError:
		break
	if x1 != x2 and y1 != y2:
		d_P1_P2 = (y2 - y1) / (x2 - x1)
		d_Q1_Q2 = -1 / d_P1_P2
		b_P1_P2 = y1 - d_P1_P2 * x1
		b_Q1_Q2 = yq - d_Q1_Q2 * xq
		xq3 = (b_Q1_Q2 - b_P1_P2) / (d_P1_P2 - d_Q1_Q2)
		yq3 = d_P1_P2 * xq3 + b_P1_P2
		xq2 = xq3 - (xq - xq3)
		yq2 = yq3 - (yq - yq3)
	elif x1 == x2:
		xq2 = x1 + x1 - xq
		yq2 = yq
	else:
		xq2 = xq
		yq2 = y1 - (yq - y1)
	print('{0:.8f} {1:.8f}'.format(xq2, yq2))


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
import sys
for (x1, y1, x2, y2, xq, yq) in (map(float, l.split(',')) for l in sys.stdin):
	vector = Vector(Point(x1, y1), Point(x2, y2))
	print(*Point(xq, yq).reflect(vector))


import sys
from math import *
for e in sys.stdin:
	(a, b, c, d, e, f) = map(float, e.split(','))
	(z, w, q) = (complex(a, b), complex(c, d), complex(e, f))
	z += (z - w) * (q - z).conjugate() / (z - w).conjugate()
	print(z.real, z.imag)


def vec(s, t):
	return [t[0] - s[0], t[1] - s[1]]

def dot(a, b):
	return a[0] * b[0] + a[1] * b[1]

def scalsquared(a):
	return a[0] ** 2 + a[1] ** 2

def project(p, a, b):
	k = dot(vec(a, p), vec(a, b)) / scalsquared(vec(a, b))
	return [a[0] + k * (b[0] - a[0]), a[1] + k * (b[1] - a[1])]

def symmetrical_point(p, q):
	return [p[0] + 2 * (q[0] - p[0]), p[1] + 2 * (q[1] - p[1])]
while True:
	try:
		tmp = [float(x) for x in input().split(',')]
		p1 = [tmp[0], tmp[1]]
		p2 = [tmp[2], tmp[3]]
		q = [tmp[4], tmp[5]]
		r = symmetrical_point(q, project(q, p1, p2))
		print(r[0], r[1])
	except:
		break


import sys
f = sys.stdin

def take2(iterable):
	while True:
		yield (next(iterable), next(iterable))
for line in f:
	(p1, p2, pq) = [x + y * 1j for (x, y) in take2(map(float, line.split(',')))]
	v21 = p2 - p1
	vq1 = pq - p1
	px = vq1 * (v21.real - v21.imag * 1j)
	px = px.real - px.imag * 1j
	px /= abs(px)
	pp = p1 + vq1 * px * px
	print('{:.6f} {:.6f}'.format(pp.real, pp.imag))


def dot(x, y):
	return (x.conjugate() * y).real

def project(p, d):
	return dot(p, d) / abs(d)

def line_sym(p, x1, x2):
	p -= x1
	d = x2 - x1
	return d * p.conjugate() / d.conjugate() + x1
import sys
p = []
for line in sys.stdin:
	(x1, y1, x2, y2, xq, yq) = map(float, line.split(','))
	p1 = complex(x1, y1)
	p2 = complex(x2, y2)
	q = complex(xq, yq)
	r = line_sym(q, p1, p2)
	print(r.real, r.imag)


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(self.x / other, self.y / other)

	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):
		return sqrt(self.norm())

	def ccw(self, p0, p1):
		a = Vector(p1 - p0)
		b = Vector(self - p0)
		if Vector.cross(a, b) > Point.epsilon:
			return 1
		elif Vector.cross(a, b) < -Point.epsilon:
			return -1
		elif Vector.dot(a, b) < -Point.epsilon:
			return 2
		elif a.norm() < b.norm():
			return -2
		else:
			return 0

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

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

	def distance(self, s):
		if Vector.dot(s.p2 - s.p1, self - s.p1) < 0.0:
			return abs(self - s.p1)
		if Vector.dot(s.p1 - s.p2, self - s.p2) < 0.0:
			return abs(self - s.p2)
		return abs(Vector.cross(s.p2 - s.p1, self - s.p1) / abs(s.p2 - s.p1))

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(self.x / other, self.y / other)

	@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 abs(Vector.dot(a, b)) < Vector.epsilon

	@classmethod
	def is_parallel(cls, a, b):
		return abs(Vector.cross(a, b)) < Vector.epsilon

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])

	def intersect(self, s):
		ans1 = s.p1.ccw(self.p1, self.p2) * s.p2.ccw(self.p1, self.p2)
		ans2 = self.p1.ccw(s.p1, s.p2) * self.p2.ccw(s.p1, s.p2)
		return ans1 <= 0 and ans2 <= 0

	def cross_point(self, s):
		base = s.p2 - s.p1
		d1 = abs(Vector.cross(base, self.p1 - s.p1))
		d2 = abs(Vector.cross(base, self.p2 - s.p1))
		t = d1 / (d1 + d2)
		return self.p1 + (self.p2 - self.p1) * t

	def distance(self, s):
		if self.intersect(s):
			return 0.0
		d1 = s.p1.distance(self)
		d2 = s.p2.distance(self)
		d3 = self.p1.distance(s)
		d4 = self.p2.distance(s)
		return min(d1, d2, d3, d4)

	@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, x, y=Point(), r=1.0):
		if isinstance(x, Point):
			self.c = x
			self.r = y
		elif isinstance(x, tuple):
			self.c = Point(x[0], x[1])
			self.r = r

	def cross_points(self, s):
		if isinstance(s, Segment):
			pr = self.c.project(s)
			e = (s.p2 - s.p1) / abs(s.p2 - s.p1)
			base = sqrt(self.r * self.r - (pr - self.c).norm())
			return (pr + e * base, pr - e * base)
		elif isinstance(s, Cirle):
			c2 = s
			d = abs(self.c - c2.c)
			a = acos((self.r * self.r + d * d - c2.r * c2.r) / (2 * self.r * d))
			t = atan2(c2.c.y - self.c.y, c2.c.x - self.c.x)
			temp1 = Point(cos(t + a) * self.r, sin(t + a) * self.r)
			temp2 = Point(cos(t - a) * self.r, sin(t - a) * self.r)
			return (self.c + temp1, self.c + temp2)

def contains(polygon, p):
	n = len(polygon)
	x = False
	for i in range(n):
		a = polygon[i] - p
		b = polygon[(i + 1) % n] - p
		if abs(Vector.cross(a, b)) < Point.epsilon and Vector.dot(a, b) < Point.epsilon:
			return 1
		if a.y > b.y:
			temp = a
			a = b
			b = temp
		if a.y < Point.epsilon and Point.epsilon < b.y and (Vector.cross(a, b) > Point.epsilon):
			x = not x
	return 2 if x else 0

def main(args):
	for line in sys.stdin:
		(x1, y1, x2, y2, xq, yq) = map(float, line.split(','))
		p1 = Point(x1, y1)
		p2 = Point(x2, y2)
		q = Point(xq, yq)
		l = Segment(p1, p2)
		result = q.reflect(l)
		print('{:.8f} {:.8f}'.format(result.x, result.y))
main(sys.argv[1:])


while 1:
	try:
		(x, y, xx, yy, l, ll) = map(float, input().split(','))
		p = complex(x, y)
		pp = complex(xx, yy)
		lp = complex(l, ll)
		lp -= p
		a = pp - p
		b = a * lp.conjugate() / a.conjugate() + p
		print(b.real, b.imag)
	except:
		break


from decimal import Decimal as D
import sys

def naiseki(A, B):
	return A[0] * B[0] + A[1] * B[1]

def scaler(k, A):
	return [k * A[0], k * A[1]]

def size(A):
	return A[0] ** 2 + A[1] ** 2

def plus(A, B):
	return [A[0] + B[0], A[1] + B[1]]
while True:
	try:
		(x1, y1, x2, y2, xq, yq) = [D(i) for i in input().split(',')]
		P1P2 = [x2 - x1, y2 - y1]
		P1Q = [xq - x1, yq - y1]
		P1H = scaler(naiseki(P1P2, P1Q) / size(P1P2), P1P2)
		QH = plus(P1H, scaler(-1, P1Q))
		QR = scaler(2, QH)
		OP1 = [x1, y1]
		OR = plus(OP1, plus(P1Q, QR))
		print(OR[0], OR[1])
	except EOFError:
		sys.exit()


while True:
	try:
		(x1, y1, x2, y2, xp, yp) = map(float, input().split(','))
		dx = x2 - x1
		dy = y2 - y1
		xr = (2 * dx * dy * yp + (dx ** 2 - dy ** 2) * xp + 2 * dy * (x1 * y2 - x2 * y1)) / (dx ** 2 + dy ** 2)
		yr = (2 * dx * dy * xp - (dx ** 2 - dy ** 2) * yp - 2 * dx * (x1 * y2 - x2 * y1)) / (dx ** 2 + dy ** 2)
		print(xr, yr)
	except EOFError:
		break


from math import sqrt, atan2, cos, sin
while 1:
	try:
		(x1, y1, x2, y2, xq, yq) = [float(i) for i in input().split(',')]
		r = sqrt((xq - x1) ** 2 + (yq - y1) ** 2)
		th1 = atan2(y2 - y1, x2 - x1)
		th2 = atan2(yq - y1, xq - x1)
		th3 = -(th2 - th1) + th1
		print('{:.6f} {:.6f}'.format(x1 + r * cos(th3), y1 + r * sin(th3)))
	except EOFError:
		break


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

def norm(a):
	return a.real ** 2 + a.imag ** 2

def project(line, p):
	base = line[1] - line[0]
	r = dot(p - line[0], base) / norm(base)
	return line[0] + base * r

def symmetric_Point(line, p):
	return p + 2 * (project(line, p) - p)
while True:
	try:
		p = list(map(float, input().split(',')))
	except:
		break
	line = []
	line.append(complex(p[0], p[1]))
	line.append(complex(p[2], p[3]))
	pp = complex(p[4], p[5])
	qq = symmetric_Point(line, pp)
	print(qq.real, qq.imag)


from math import *
while True:
	try:
		(x1, y1, x2, y2, xp, yp) = map(float, input().split(','))
	except:
		break
	(ang, x, y) = ((atan2(yp - y1, xp - x1) - atan2(y2 - y1, x2 - x1)) * -2.0, xp - x1, yp - y1)
	print('{0:.6f} {1:.6f}'.format(x * cos(ang) - y * sin(ang) + x1, y * cos(ang) + x * sin(ang) + y1))


while True:
	try:
		(x1, y1, x2, y2, xq, yq) = map(float, input().split(','))
		if y2 - y1 == 0:
			xr = xq
			yr = 2 * y1 - yq
		elif x2 - x1 == 0:
			xr = 2 * x1 - xq
			yr = yq
		else:
			a12 = (y2 - y1) / (x2 - x1)
			aqr = -1 / a12
			b12 = y1 - a12 * x1
			bqr = yq - aqr * xq
			xm = -(b12 - bqr) / (a12 - aqr)
			ym = aqr * xm + bqr
			xr = 2 * xm - xq
			yr = 2 * ym - yq
		print(xr, yr)
	except:
		break


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

def norm(a):
	return a.real ** 2 + a.imag ** 2

def project(line, p):
	base = line[1] - line[0]
	r = dot(p - line[0], base) / norm(base)
	return line[0] + base * r

def symmetric_Point(line, p):
	return p + 2 * (project(line, p) - p)
while True:
	try:
		p = list(map(float, input().split(',')))
	except:
		break
	line = []
	line.append(complex(p[0], p[1]))
	line.append(complex(p[2], p[3]))
	pp = complex(p[4], p[5])
	qq = symmetric_Point(line, pp)
	print(qq.real, qq.imag)


def line_sym(p, x1, x2):
	p -= x1
	d = x2 - x1
	return d * p.conjugate() / d.conjugate() + x1
import sys
p = []
for line in sys.stdin:
	(x1, y1, x2, y2, xq, yq) = map(float, line.split(','))
	p1 = complex(x1, y1)
	p2 = complex(x2, y2)
	q = complex(xq, yq)
	r = line_sym(q, p1, p2)
	print(r.real, r.imag)


import sys
from math import *
for e in sys.stdin:
	(a, b, c, d, e, f) = map(float, e.split(','))
	(z, w, q) = (complex(a, b), complex(c, d), complex(e, f))
	z += ((z - w) / abs(z - w)) ** 2 * (q - z).conjugate()
	print(z.real, z.imag)


import sys
from math import *
for e in sys.stdin:
	(a, b, c, d, e, f) = map(float, e.split(','))
	(z, w, q) = (complex(a, b), complex(c, d), complex(e, f))
	w -= z
	z += (w / abs(w)) ** 2 * (q - z).conjugate()
	print(z.real, z.imag)


import sys
import os
import math

class Vector2:

	def __init__(self, x, y):
		self._x = float(x)
		self._y = float(y)

	def normalize(self):
		norm = self.norm()
		return Vector2(self._x / norm, self._y / norm)

	def norm(self):
		return math.sqrt(self._x ** 2 + self._y ** 2)

	def dot(self, other):
		return self._x * other._x + self._y * other._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 __str__(self):
		round_x = round(self._x, 6)
		round_y = round(self._y, 6)
		return '{} {}'.format(round_x, round_y)

	def __mul__(self, scale):
		return Vector2(self._x * scale, self._y * scale)
for s in sys.stdin:
	(x1, y1, x2, y2, xq, yq) = map(float, s.split(','))
	OP1 = Vector2(x1, y1)
	OP2 = Vector2(x2, y2)
	OQ = Vector2(xq, yq)
	P2P1 = OP2 - OP1
	N = P2P1.normalize()
	P1Q = OQ - OP1
	dot = P1Q.dot(N)
	P1O = N * dot
	QO = P1O - P1Q
	OR = OP1 + P1O + QO
	print(OR)


try:
	while True:
		T = tuple(map(float, input().strip().split(',')))
		z = complex(T[0] - T[2], T[1] - T[3])
		P = complex(T[0], T[1])
		Q = complex(T[4], T[5])
		R = P + (Q - P).conjugate() * z / z.conjugate()
		print('%.6f %.6f' % (R.real, R.imag))
except EOFError:
	pass


import sys
from decimal import Decimal
for l in sys.stdin:
	(x1, y1, x2, y2, xq, yq) = list(map(Decimal, l.split(',')))
	a = x1 - x2
	b = y1 - y2
	c = xq - 2 * x1
	d = yq - 2 * y1
	e = yq - y1
	X = (xq * a ** 2 - c * b ** 2 + 2 * e * a * b) / (a ** 2 + b ** 2)
	try:
		Y = b / a * (X + c) - d
	except:
		Y = -a / b * (X - xq) + yq
	print(' '.join(['{:.6f}'.format(i) for i in [X, Y]]))


import sys, math, os
PYDEV = os.environ.get('PYDEV')
if PYDEV == 'True':
	sys.stdin = open('sample-input.txt', 'rt')

def symmetric_point(x1, y1, x2, y2, xq, yq):
	rx = x2 - x1
	ry = y2 - y1
	det = -rx ** 2 - ry ** 2
	det_s = rx * (yq - y1) - ry * (xq - x1)
	s = det_s / det
	xr = xq - 2 * s * ry
	yr = yq + 2 * s * rx
	return (xr, yr)
for line in sys.stdin:
	(x1, y1, x2, y2, xq, yq) = [float(_) for _ in line.split(',')]
	(xr, yr) = symmetric_point(x1, y1, x2, y2, xq, yq)
	print('%.6f %.6f' % (xr, yr))