K = int(input()) s = "ABCDE" a = ["", "", "", ""] for i in range(5): a[(K + i) % 4] += s[(K + i) % 5] print(*a, sep="\n")