def get_winner(s):
	for p in ['o','x']:
		for i in xrange(3):
			win_h=True
			win_v=True
			for j in xrange(3):
				if s[i*3+j]!=p:
					win_h=False
				if s[j*3+i]!=p:
					win_v=False
			if win_h or win_v:
				return p
		if p==s[0]==s[4]==s[8] or p==s[2]==s[4]==s[5]:
			return p
	return 'd'

while 1:
	try:
		s=raw_input()
		print get_winner(s)
	except  EOFError:
		break