Trokut
Time limit0.5sMemory limit256 MB
Given two numbers in this triangular arrangement, list every third number that completes an equilateral triangle with sides parallel to the 1-2-3 grid.
Problem
Write every natural number in a triangle: one number in the first row, two numbers in the second row, and one more number in each row after that. The result is the structure in the picture.

The structure contains equilateral triangles. Such a triangle is given by three of the numbers as its vertices, subject to both of these conditions.
- The three sides have equal length.
- Each side is parallel to one of the three segments that join 1, 2 and 3.
For example, 4, 6 and 13 form an equilateral triangle. The numbers 2, 6 and 8 do not, because their sides have equal length but are not parallel to the segments joining 1, 2 and 3.
Given two numbers, find every third number that forms an equilateral triangle with them.
Input
The first and only line contains two natural numbers and , where and .
Output
Print on one line the numbers that can be the third vertex, separated by single spaces. If there is more than one such number, print them in increasing order. If there is no such number, print nema.
The value of the third vertex can be larger than .