#include <bits/stdc++.h>
using namespace std;

template<typename T>
class custom_priority_queue_MinHeap : public std::priority_queue<T, std::vector<T>>
{
  public:
      bool remove(const T& value) 
      {
        auto it = std::find(this->c.begin(), this->c.end(), value);
        if (it != this->c.end())
        {
            this->c.erase(it);
            std::make_heap(this->c.begin(), this->c.end(), this->comp);
            return true;
        }
    
        return false;
    }
    
    bool operator()(const pair<int, int> &a, const pair<int, int> &b)
    {
        cout << "Custom comparator called" << endl;
        return a.second > b.second;
    }
};

int main() {
	custom_priority_queue_MinHeap<pair<int, int>> minHeap;
	minHeap.push({0, 10});
	minHeap.push({1, 5});
	minHeap.push({2, 15});
	
	while(!minHeap.empty())
	{
		pair<int, int> p = minHeap.top();
		minHeap.pop();
		cout << p.first << " " << p.second << endl;
	}
	
	return 0;
}