import java.util.*; import java.lang.*; import java.io.*; class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); List bookList = new ArrayList<>(); for (int i=0; i{ @Override public int compare(Book book1 , Book book2){ if(book1.getTitle().compareTo(book2.getTitle()) == 0){ if(book1.getNumber() > book2.getNumber()){ return 1; }else if(book1.getNumber() < book2.getNumber()){ return -1; } }else{ return book1.getTitle().compareTo(book2.getTitle()); } return 0; } }