Doubt in how comparator function works with priority queue

What will be the output of following C++ code?

#include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> pi;
struct Compare
{
bool operator()(pi const & a, pi const & b)
{
if(a.second < b.second)
{
return true;
}
else if(a.second > b.second)
{
return false;
}
else
{
if(a.first > b.first)
{
return true;
}
return false;
}
}
};
int main()
{
priority_queue<pi , vector, Compare>q;
q.push({1, 5});
q.push({5, 15});
q.push({7, 15});
q.push({10, 2});
q.push({1, 10});
cout<<q.top().first<<" "<<q.top().second<<endl;
return 0;
}
can you please explain the working

ans should be 5,15
as comparator in priority queue judges the element in opposite way as in sort function

what i mean is in priority queue Compare(a,b) tells us whether in the priority queue a will come before b or after b if

Compare(a,b) return true means a will come after b (b before a) and in case of false a will come before b

in this code you can judge that if a.second is greater than b.second then a will come before a or if a.second is less than b.second then b will come before a in case of equality in b.second we will check for a.first and b.first in that case if a.first is greater than b.first then it will come after b

so you can say that in priority queue the elements are stored in desending order wrt to element.second and in case the element.second are equal then they are stored in increasing order of element .first