﻿using System;
using System.Linq;
using System.Collections.Generic;
class Sheets
{
    static void Main()
    {
        List<int> powers = new List<int> {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11};
        List<int> usedPowers = new List<int> {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11};


        int number = int.Parse(Console.ReadLine());

        while (number > 0)
        {
            for (int i = 0; i < 12; i++)
            {
                if (Math.Pow(2, powers[i]) > number)
                {
                    number -= (int) Math.Pow(2, powers[i - 1]);
                    usedPowers[i - 1] = -1;
                    break;
                }

                else if (Math.Pow(2, powers[i]) == number)
                {
                    number = 0;
                    usedPowers[i] = -1;
                    break;
                }
                
            }
        }

        
        foreach (var power in usedPowers)
        {
            if (power != -1 && power != 11)
            {
                Console.WriteLine("A{0}", 10 - power);
            }
        }
    }
}

