#!/usr/local/bin/python3

start = 'yamada'
b = [('suzuki', 'satou'), ('yamada', 'tanaka'), ('tanaka', 'satou'), ('watanabe', 'suzuki')]

ans = [start]
cur = start
pairs = b.copy()

while pairs:
    found = False
    for i, pair in enumerate(pairs):
        if cur not in pair: continue
        found = True
        cur = pair[1] if pair[0] == cur else pair[0]
        ans.append(cur)
        del pairs[i]
        break
    if not found:
        raise Exception('{} is not found'.format(cur))

print(ans)