processors =16
n=32

def a[20]

i=n/2

thingplus%=pid*2
thing%=thingplus%-1

a[thing%]=thing%
a[thingplus%]=thingplus%




j=0
k=0
while (i>=pid)
{		
	one%=a[thing%]
	two%=a[thingplus%]
	result%= one%+ two%
	a[pid]=result%

	if (k==1)
	{
		if (pid==i)
		{
			a[pid]=a[thing%]
		}
	}		

	b=i
	if (pid==1)
	{
		i = i/2
	
	c=b.2		
	if (c!=0)
	{
		if (i!=0)
		{	
			i++
			k=1
		}
	} else {

		k=0
	}	
	}
	sync
}

if (pid==1)
{
	println a[1]
}