eolymp
bolt
Try our new interface for solving problems
Problems

Get equal

Get equal

Time limit 1 second
Memory limit 64 MiB

On the table there are cards. On each card it is written some number. Moreover, there is a quite large stack of empty cards. For one turn, it is allowed take away from the table two cards with equal numbers, then take two empty cards from stack, write a number on each of them and put them on the table.

It is required to determine how to make in minimal number of turns the equal numbers were written on all cards on the table.

Input data

The first line contains the number of cards N on the table (1 ≤ N30000). The second line consists of N numbers, written of cards. All numbers is positive integer and does not exceed 10^9.

Output data

On the first line output the minimal number of operations L, which necessary to get all equal cards on the table. On each of following L lines output four numbers describing corresponding turn: first and second ones are numbers on taken off cards, third and fourth ones are numbers written on new cards. If it is impossible to get all equal cards, output the only number -1.

Examples

Input example #1
3
1 2 2
Output example #1
1
2 2 1 1
Author В.Неспирный
Source Зимние сборы в Харькове 2010 День 1