Imports System.Collections.Generic
Imports System.Console
Module Program
    Sub Main()
        Dim Boarding_Sit = Gets()
        Dim StrInput1 = Boarding_Sit(0), StrInput2 = Boarding_Sit(1), StrInput3 = Boarding_Sit(2)
        Dim Str_Sit As String()
        Dim ans As String = ""
        If CInt(StrInput2) < 1 Or CInt(StrInput2) > 50 Then
            Exit Sub
        End If
        If StrInput1 = "S" Or StrInput1 = "s" Then
            If CInt(StrInput3) < 1 Or CInt(StrInput3) > 6 Then
                Exit Sub
            End If
            Str_Sit = {"A", "B", "C", "H", "J", "K"}
            ans = StrInput2 & Str_Sit(CInt(StrInput3) - 1)
        ElseIf StrInput1 = "L" Or StrInput1 = "l" Then
            If CInt(StrInput3) < 1 Or CInt(StrInput3) > 10 Then
                Exit Sub
            End If
            Str_Sit = {"A", "B", "C", "D", "E", "F", "G", "H", "J", "K"}
            ans = StrInput2 & Str_Sit(CInt(StrInput3) - 1)
        Else
            Exit Sub
        End If
        Console.WriteLine(ans)
        Console.ReadLine()
    End Sub
    Function Gets() As String()
        Gets = Console.ReadLine().Split(" "c)
    End Function
End Module