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]))