404516: GYM101522 H Hit!

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

H. Hit!time limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

"Hit!" is a popular game in ancient Byteland.

The very first version of the game is quite simple: each player picks up a stone and throws it at a circle drawn on the ground. A player wins if his/her stone lands inside the circle.

After 20 years of practice, Bitman, a young man living in ancient Byteland, has mastered the skill of throwing stones – he can throw a stone at any specific place he wants. With such skill, Bitman plays "Hit!" without losing a single game. He simply targets every stone at the center of the circle!

The King of Hackerland hears the story of Bitman and wants to challenge him with a harder, though still very simple, version of "Hit!".

In each game, two circles which share a positive common area are drawn on the ground. In order to win, the player must throw a stone at the common area of the two circles.

As Bitman had no idea how to target his stone at the common area, he asks for your help. Given the coordinates of the centers and radii of the two circles, please tell Bitman the coordinates of any point he can target at such that he can win the game.

For simplicity, you can consider the landing position of the stone as a single point.

Input

The input consists of two lines, each describes one circle drawn on the ground. Each line contains three integers x, y and r, denoting respectively the x-coordinate, y-coordinate, and the radius of a circle.

All coordinates have their absolute value no more than 100, and 1 ≤ r ≤ 100 for both circles.

Output

Output two numbers, the x-coordinate and y-coordinate of a point where Bitman can throw his stone at to win the game.

Your answer will be accepted if for each of the two circles, the point lies inside the circle or that the distance between the point and the circle is not greater than 10 - 5.

ExamplesInput
0 0 3
3 4 3
Output
1.5 2.5
Input
-7 -9 3
-4 -4 5
Output
-6 -7
Note

In the first sample, (1.5, 2.5) is a possible answer as it lies inside the common area of two circles drawn. Please note that there exists more than one possible answer in this case. For example, (2, 2), (1, 2) and (2.1, 1.87) are also possible answers.

加入题单

上一题 下一题 算法标签: