public static int[] assignNextMin(int heap[])
	{		
		int pos = -1;
		int min = 0;
		if( a1.length > (p1+1) )
		{			
			min = a1[p1+1];
			pos = 0;
		}		
		if( a2.length > (p2+1) )
		{
			int value = a2[p2+1];
			if(value < min)
			{
				min = value;			
				pos = 1;
			}
		}			
		if( a3.length > (p3+1))
		{
			int value = a3[p3+1];
			if(value < min)
			{
				min = value;			
				pos = 2;
			}
		}
				
		if(pos<0)
			stop = true;
		else
		{
			heap[pos] = min;
			switch(pos)
			{
				case 0: p1++; break;
				case 1: p2++; break;
				case 2: p3++; break;
			}			
		}
		BaseOperations.printArray(heap);
		return heap;
	}