/* package whatever; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;
import java.math.BigInteger;

/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
	public static void main (String[] args) throws java.lang.Exception
	{
		BigInteger start = new BigInteger("1");
		BigInteger limit = new BigInteger("10");
		BigInteger zap1 = new BigInteger("0");
		BigInteger zap2 = new BigInteger("0");
		BigInteger n2 = new BigInteger("2"); // formula(1) progressiva
		BigInteger n4 = new BigInteger("4"); // formula(2) progressiva
		BigInteger soma1 = new BigInteger("1"); // número(1) estabelecido
		BigInteger soma2 = new BigInteger("3"); // número(2) estabelecido

		for (BigInteger a = start, b=start; a.compareTo(limit) <= 0 && b.compareTo(limit) <= 0;) {

			int comparacao = zap1.add(soma1).compareTo(zap2.add(soma2));
			
			if (comparacao == 0 && zap1.compareTo(BigInteger.ZERO) != 0 && zap2.compareTo(BigInteger.ZERO) != 0) {
				System.out.println(zap1.add(BigInteger.ONE));
			}
			
			if (comparacao <= 0) {
				
				zap1 = zap1.add(n2.multiply(a)); // formula(1) progressiva
				a = a.add(BigInteger.ONE);
			}
			else {
				
				zap2 = zap2.add(n4.multiply(b)); // formula(2) progressiva
				b = b.add(BigInteger.ONE);
			}

		}
	}
}