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