End of Strike ------------- There is a lot of speculation about the length of the current strike. Lots of people have made predictions. You are given a number of collections of predictions. For each collection, you have to determine the most optimistic, that is, the earliest prediction, and the most pessimistic prediction, that is, the latest prediction. Input ----- The first line of the input consists of the number of collections of predictions. You may assume that this number is greater than zero. The size of each collection of predictions is at least two. Each date is given on a separate line. Each date is formatted as follows: , where is either Sep, Oct, Nov, Dec or Jan, is a number in the range 1-31, and is either 2008 or 2009. Each collection of predictions is terminated by a date in the past. This date should not be considered when determining the optimistic and the most pessimistic prediction, but is counted when determining the size of the collection of predictions. Output ------ For each set of predictions, you print the most optimistic and the most pessimistic prediction. Each prediction is printed on a separate line. The dates are formatted as in the input. Sample Input ------------ 2 Dec 12, 2008 Dec 9, 2008 Jan 1, 2009 Dec 29, 2008 Sep 17, 2008 Nov 21, 2008 Jan 4, 2009 Dec 5, 2008 Dec 9, 2008 Dec 4, 2008 Dec 17, 2008 Dec 15, 2008 Dec 13, 2008 Jan 3, 2009 Jan 13, 2009 Jan 5, 2009 Dec 14, 2008 Dec 18, 2008 Dec 27, 2008 Jan 8, 2009 Nov 10, 2008 Sample Output ------------- Dec 9, 2008 Jan 1, 2009 Nov 21, 2008 Jan 13, 2009