public int exact(int[] heap, int tail) {
			if (tail < 1) {
				return -1;
			}
			int temp = heap[1];
			heap[1] = heap[tail];
			heap[tail] = 0;
			int parent = 1;
			while (true) {
				if (parent >= tail) {
					break;
				}
				int child = parent * 2;
				if (child >= tail) {
					break;
				}
				if (child + 1 < tail && heap[child + 1] < heap[child]) {
					++child;
				}
				if (heap[child] < heap[parent]) {
					swap(heap, parent, child);
				}
				parent = child;
			}
			return temp;
		}