eolymp
bolt
Try our new interface for solving problems
Problems

Fibonacci Subsequence

Fibonacci Subsequence

Time limit 1 second
Memory limit 64 MiB

A sequence of integer numbers a_1, a_2, ..., a_n is called a Fibonacci sequence if a_i = a_{i-2} + a_{i-1} for all i = 3, 4, ..., n.

Given a sequence of integer numbers c_1, c_2, ..., c_m you have to find its longest Fibonacci subsequence.

Input data

The first line of the input file contains m (1 m 3000). Next line contains m integer numbers not exceeding 10^9 by their absolute value.

Output data

On the first line of the output file print the maximal length of the Fibonacci subsequence of the given sequence. On the second line print the subsequence itself.

Examples

Input example #1
10
1 1 3 -1 2 0 5 -1 -1 8
Output example #1
5
1 -1 0 -1 -1
Source 2004 Petrozavodsk, Summer, Andrew Stankevich Contest 7, August 22, Problem C