Trokut

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.

Medium6MathGeometryNo attempts yetTime limit0.5sMemory limit256 MB

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.

  1. The three sides have equal length.
  2. 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 AA and BB, where 1A,B5000000001 \le A, B \le 500\,000\,000 and ABA \neq B.

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 500000000500\,000\,000.