For this Question: Given N integers, your task is to add these elements to the PriorityQueue. Also, given M integers, the task is to check if element is present in PriorityQueue. If present, print 1 and return the max element of priority queue, and then delete the max element. If not present, print -1.First line contains N, number of elements to be inserted into the Priority Queue. Second line contains N positive integers separated by space. Third line contains M, fourth line contains M positive integers.

Constraints:

1 <= M <= N <= 10^3
1 <= Arr[i] <= 10^3For each query, print "1" and max element in newlines if element to be found is present in the PriorityQueue, else print "-1". (use new line for each output, as shown in example)Sample Input:
1
8
1 2 3 4 5 2 3 1
5
1 3 2 9 10

Sample Output:
1
5
1
4
1
3
-1
-1, I have written this Solution Code: m=int(input())
l=list(map(int,input().split()))
p=int(input())
q=list(map(int,input().split()))
for i in q:
	if(i in l):
		print("1")
		print(max(l))
		l.remove(max(l))
	else:
		print("-1"), In this Programming Language: Python, Now tell me if this Code is compilable or not?