Skip to content

Baekjoon 10610

1. Problem

문제 확인하기

2. Solution

N = list(input())
N.sort(reverse=True)
sum = 0
for i in N:
    sum += int(i)
if sum % 3 != 0 or "0" not in N:
    print(-1)
else:
    print(''.join(N))