Under construction

Still being built. Things may change

Trokut

Time limit0.5sMemory limit256 MB

Summary
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.
Level

Medium6 of 10

Topics
Math, Geometry
Solved
No attempts yet

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 1≤A,B≤500 000 0001 \le A, B \le 500\,000\,000 and A≠BA \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 500 000 000500\,000\,000.

Examples3

  1. Example 1

    Input
    2 6
    
    Expected output
    nema
    
  2. Example 2

    Input
    2 9
    
    Expected output
    7
    
  3. Example 3

    Input
    6 4
    
    Expected output
    1 13