processors =6
def a[13]
i=nprocessors


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

a[thing%]=thing%
a[thingplus%]=thingplus%
println a[thing%]
println a[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
	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]
}