using System; using System.IO; using System.Linq; using System.Collections.Generic; using System.Text; public class Program { public void Proc() { int[] inpt = Reader.ReadLine().Split(' ').Select(a => int.Parse(a)).ToArray(); int target = inpt[0]; int cnt = inpt[1]; List list = new List(); for (int i = 0; i < cnt-1; i++) { list.Add(int.Parse(Reader.ReadLine())); } list.Add(target); list = list.OrderByDescending(a => a).ToList(); int ans = list.IndexOf(target) + 1; string ansStr; if(ans%10==1) { ansStr = ans + "st"; }else if(ans%10==2) { ansStr = ans + "nd"; } else if(ans%10==3) { ansStr = ans + "rd"; } else { ansStr = ans + "th"; } Console.WriteLine(ansStr); } public class Reader { private static StringReader sr; public static bool IsDebug = false; public static string ReadLine() { if (IsDebug) { if (sr == null) { sr = new StringReader(InputText.Trim()); } return sr.ReadLine(); } else { return Console.ReadLine(); } } private static string InputText = @" 157 4 160 175 168 "; } public static void Main(string[] args) { #if DEBUG Reader.IsDebug = true; #endif Program prg = new Program(); prg.Proc(); } }