// Arup Guha
// 3/8/2026
// Solution for COP 3330 Quiz 3 Question 9.

import java.util.*;

public class EloChange implements Comparable<EloChange>{

    private int oldEloScore;
	private int newEloScore;
	
	public EloChange(int oldS, int newS) {
		oldEloScore = oldS;
		newEloScore = newS;
	}

	// This is the method required for the quiz.
	public int compareTo(EloChange other) {
		return (oldEloScore-newEloScore) - (other.oldEloScore-other.newEloScore);
	}

	public String toString() {
		return "("+ oldEloScore + ", "+ newEloScore + ")";
		
	}
	public static void main(String[] args) {
	
		// Test in question.
		EloChange[] list = new EloChange[5];
		list[0] = new EloChange(1500,1600);
		list[1] = new EloChange(1300,1350);
		list[2] = new EloChange(2000,2200);
		list[3] = new EloChange(1750,1900);
		list[4] = new EloChange(1800,1700);
		
		// Sort and print.
		Arrays.sort(list);
		for (int i=0; i<list.length; i++)
			System.out.println(list[i]);
	}
}
