e-olymp
Competitions

Quick Start C: Loops, Arrays, Functions

Neighbors of the same sign

Array of n integers is given. Print the pairs of adjacent elements of the same sign. If there are no adjacent elements of the same sign, print nothing.

Input

First line contains number n. Next line contains n integers. All numbers do not exceed 100 by absolute value.

Output

Print the pairs of adjacent elements of the same sign.

Time limit 1 second
Memory limit 128 MiB
Input example #1
7
9 5 -7 -7 5 -9 -4
Output example #1
9 5
-7 -7
-9 -4