#!/usr/bin/env python3import sys
occ=[{}for _ inrange(8)]for line in sys.stdin:for i inrange(8):
occ[i][line[i]]=occ[i].get(line[i],0)+1for d in occ:
mincount=1e300
minat=Nonefor k in d:if d[k]<mincount:
mincount=d[k]
minat=k
print(minat,end="")print()