S = ["Z", "B", "S", "E", "D"] ans = ["1st", "2nd", "3rd", "4th", "Alpha"] print(ans[S.index(input()[0])])