using System; using System.Collections.Generic; using System.Linq; namespace Test { class Program { static void Main(string[] args) { int[] x = Console.ReadLine().Split().Select(int.Parse).ToArray(); int ret = 1; for (int i = 0; i < x[1] - 1; i++) { if (x[0] < int.Parse(Console.ReadLine())) ret++; } Console.Write(ret); switch (ret % 10) { case (1): { Console.WriteLine("st"); break; } case (2): { Console.WriteLine("nd"); break; } case (3): { Console.WriteLine("rd"); break; } default: { Console.WriteLine("th"); break; } } } } }