from itertools import product

types = ["пик", "треф", "бубен", "червей"]

majors = ["валет", "дама", "король", "туз"]
m = types.index(input())

for a, b in product([str(i) for i in range(2, 11)] + majors, types[:m] + types[m + 1:]):
    print(a, b)