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