n=int(input()) i=n//7 while i>=0: if (n-7*i)%4==0: print("4"*((n-i*7)//4)+"7"*i) break i=i-1 else: print("-1")