For this Question: An interviewer is asking you questions in form of queries. For your assistance, he has provided you with an empty array. Queries are of 4 types:-

(1 X) Add given element X to end of the array
(2 X) Delete the first instance of given element X from the array(if element is not present print -1)
(3)     Return maximum element of the array.
(4)     Return minimum element of the array.

See example for more clarificationThe first line contains an integer Q.
The next Q lines will each contain a query as mentioned above:- 

Constraints:
1 <= Q <= 100000
1 <= X <= 100000For queries 3 and 4, print the answer in a new line. If the array is empty for query 2, 3 or 4, then print "-1" without the quotes.Sample Input:-
6
1 5
1 9
1 1
3
2 1
2 1

Sample Output:-
9
-1

There are 5 queries.
Query 1 -> 5 is added to the array.
Query 2 -> 9 is added to the array.
Query 3 -> 1 is added to the array.
Query 4 -> The maximum element in the array is 9.
Query 5 -> The element 1 is deleted from the array.
Query 6 -> Since there is no element in the array with value 1, so the output is -1., I have written this Solution Code: from heapq import heappush,heappop,heapify

queries = int(input())

hash_map = {}
heap_min = []
heap_max = []
heapify(heap_min)
heapify(heap_max)
for _ in range(queries):
	query = (input().split())
	
	if int(query[0]) == 1:
		type = 1
		X = int(query[1])
	elif int(query[0]) == 2:
		type = 2
		X = int(query[1])
	else:
		type = int(query[0])
	
	if type == 1:
		if X not in hash_map:
			hash_map[X] = 0
		hash_map[X] += 1
		heappush(heap_min,X)
		heappush(heap_max,-X)
	# print(hash_map)
	if type == 2:
		if X in hash_map and hash_map[X] > 0:
			hash_map[X] -= 1
			heap_min.remove(X)
			heap_max.remove(-X)
		else:
			
			print("-1")
	if type == 3:
		if len(heap_max) > 0:
			print(-heap_max[0])
		else:
			print("-1")
	if type == 4:
		if len(heap_min) > 0:
			print(heap_min[0])
		else:
			print("-1"), In this Programming Language: Python, Now tell me if this Code is compilable or not?