Splitting the Bureks

Time limit1sMemory limit128 MB

Problem

Mirko and Slavko are having burek for breakfast: one with cheese and one with meat. They cannot decide who should get which one, so they decide to split both bureks exactly in half. Mirko claims he can cut both bureks into two equal-area parts with one straight stroke of his knife. Find that line before the bureks get cold.

The image shows one possible arrangement.

Each burek is a convex polygon. One polygon lies completely to the left of the y-axis, and the other lies completely to the right of it.

Given the two polygons, compute the equation of the line that splits each of them into two parts of equal area.

Input

The first line contains an integer N (3 ≤ N ≤ 5000), the number of vertices of the first burek.

Each of the next N lines contains two real numbers X and Y in decimal notation (-1000 < X < 0, -1000 < Y < 1000), the coordinates of one vertex of the first burek.

The second burek is then given in the same format: first its number of vertices, followed by its vertex coordinates.

For both bureks, vertices are listed in counterclockwise order. Every coordinate is written with exactly three digits after the decimal point. No three vertices of the same polygon are collinear.

Output

Output two numbers A and B such that y = A ⋅ x + B is the line Mirko should use. Your output must be within ±0.001 of the correct values.

A solution always exists and is unique.