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