Start: Jul, 17, 2019 00:00:00
20190717Python程序设计基础培训第三次作业
End: Jul, 21, 2019 00:00:00
Time elapsed:
Time remaining:

Problem_ID: E
Result: Accepted
Time: 48ms
Memory: 25320kB
Author: shanzhenyu
In contest: 1295

d1 = {0:0,1:1,2:2,3:3,4:0,5:1,6:2}
d2 = {0:0,1:2,2:4,3:6,4:1,5:3,6:5}
n = int(input())
i,j = n//7,n%7
if d1[j] > i:
    print("-1")
else:
    print("4"*d2[j]+"7"*(i-d1[j]))