def preprocess(s):
return sorted([set(map(int, subset.split(','))) for subset in s.strip('{}').split('},{')],key = lambda x: len(x))
def solution(s):
answer = []
lst = preprocess(s)
answer.append(list(lst[0])[0])
for i in range(1,len(lst)):
answer.append(list(lst[i]-lst[i-1])[0])
return answer