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