using System;

namespace y
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] ss = Console.ReadLine().Split();
            int h = int.Parse(ss[0]);
            int n = int.Parse(ss[1]);
            int a = 1;

            for (int i = 0; i < n - 1; i++)
            {
                int h2 = int.Parse(Console.ReadLine());
                if (h < h2)
                {
                    a++;
                }
            }

            switch (a.ToString()[a.ToString().Length - 1])
            {
                case '1':
                    Console.WriteLine("1st");
                    break;
                case '2':
                    Console.WriteLine("2nd");
                    break;
                case '3':
                    Console.WriteLine("3rd");
                    break;
                default:
                    Console.WriteLine(a.ToString() + "th");
                    break;
            }
        }
    }
}