# 튜플 - 프로그래머스
def solution(s):
ret = []
s = s.replace('{','[').replace('}',']')
sorted_s = sorted(eval(s), key=lambda x: len(x))
length = len(sorted_s)
for idx, i in enumerate(sorted_s):
if idx == 0:
ret.append(i[0])
continue
ele = set(i) - set(sorted_s[idx - 1])
ret.append(list(ele)[0])
return ret