n = input().split()[1]

print(('A%sC'%n[0]))
a = input().split()

print((a[0][0] + a[1][0] + a[2][0]))
n = input().split()[1]
print(("A%sC" % n[0]))

a = input().split()
print((a[0][0] + a[1][0] + a[2][0]))

-n = input().split()[1] -print(("A%sC" % n[0])) +a = input().split() +print((a[0][0] + a[1][0] + a[2][0]))