set去重
n = int(input()) li = list(input().split()) se = set() for i in range(len(li)): a = 0 for x in li[i]: a += int(x) se.add(a) ans = sorted(se) print(len(ans)) print(*ans)