public List<int[]> sortFraction2(int n) {
		Queue<int[]> pq=new PriorityQueue<>(n, (int[]a,int[]b)->(a[0]*b[1]-a[1]*b[0]));
		
		List<int[]> l=new ArrayList<>();
		l.add(new int[]{0,1});
		for (int d=1;d<=n;++d) {
			for (int e=1;e<=d;++e) {
				if (gcd(d, e)!=1) continue;
				pq.add(new int[]{e,d});
			}
		}
		while (!pq.isEmpty()) l.add(pq.poll());
		return l;
	}