n=int(input()) for i in range(int(n/7),-1,-1): if (n-7*i)%4==0: print('4'*int((n-7*i)/4)+'7'*i) break if i==0 and (n-7*i)%4!=0: print ('-1')