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