#一行题解#

print(str(sum(int(x) for x in input().split()) % 7).replace("0", "7"))