/* package whatever; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
	public static class Pair{
		int key;
		int value;
		
		Pair(int key,int value){
			this.key=key;
			this.value=value;
		}
	}
	public static void main (String[] args) throws java.lang.Exception
	{
		// your code goes here
		PriorityQueue<Pair> pq = new PriorityQueue<>((a,b)-> a.value - b.value);
		pq.add(new Pair(1,20));
		pq.add(new Pair(2,90));
		pq.add(new Pair(3,40));
		pq.add(new Pair(4,50));
		pq.add(new Pair(5,80));
		pq.add(new Pair(6,70));
		pq.add(new Pair(7,60));
		pq.add(new Pair(8,30));
		pq.add(new Pair(9,10));
		while(!pq.isEmpty()){
			Pair p = pq.poll();
			System.out.println(p.key+"->"+p.value);
		}
	}
}