if(typ == 1) {
int x = sc.nextInt();
int y = sc.nextInt();
int dis = x*x+y*y;
pq.add(dis);
}
else {
int[] arr = new int[k-1];
for(int i = 0; i< k-1; i++) {
arr[i] = pq.peek();
pq.remove();
}
System.out.println(pq.peek());
for(int i = 0; i< k-1; i++) {
pq.add(arr[i]);
}