/* 
  4 6 2 3 9 6 8

  2 3 4 6 6 8 9

  9 8 6 6 4 3 2

  3 9 8 6 6 4 2 

 */

import java.util.*; 

class Player implements Comparable<Player> {
  int score;
  String name;
  Player(String name, int score) {
    this.name = name; 
    this.score = score; 
  } 
  public String toString() {
    return this.name + ":" + this.score; 
  } 
  public int compareTo(Player other) {
    if (this.score % 2 == 0) 
      if (other.score % 2 == 0)
        if (this.score < other.score) 
          return 1; // swap us
        else if (this.score > other.score) 
          return -1; 
        else 
          return 0; 
      else return 1; // swap us
    else if (other.score % 2 == 1) 
           if (this.score < other.score) 
             return -1; 
           else if (this.score > other.score) 
             return 1; 
           else return 0;
         else return -1; 
  } 
}

class Judge implements Comparator<Player> {
  public int compare(Player a, Player b) {
    if (a.score < b.score) return -1; 
    else if (a.score > b.score) return 1; 
    else return 0; 
  } 
}

class Program {
  public static void main(String[] args) {
    ArrayList<Player> players = new ArrayList<Player>(); 
    players.add(new Player("Leslie", 20)); 
    players.add(new Player("Alex"  , 23)); 
    players.add(new Player("Larry" , 15)); 
    players.add(new Player("Laura" ,  9)); 
    System.out.println( players );     
    Collections.sort( players ); 
    System.out.println( players );
    Collections.sort( players, new Judge() ); 
    System.out.println( players );    
    Player a = new Player("Kun", 21); 
    System.out.println( a.toString() ); 
  }
}