import java.util.*;
public class TestMid
{
  public static void main(String[] args)
  {
    Scanner sc = new Scanner(System.in);
    System.out.println("Enter two mids: ex. Joe Blough m159785 1 23");
    Mid m1 = Mid.read(sc);
    Mid m2 = Mid.read(sc);
    if (m1.before(m2))
      System.out.println(m1 + "\n" + m2);
    else
      System.out.println(m2 + "\n" + m1);
  }
}