print(*[i[0] for i in input().split()],sep='')

print(f'A{input()[8]}C')
print(*[i[0] for i in input().split()], sep="")

print(f"A{input()[8]}C")

-print(*[i[0] for i in input().split()], sep="") +print(f"A{input()[8]}C")