#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, seven, rest, four, i;
  scanf("%d", &n);
  seven = n / 7;
  rest = n % 7;
  if (!(rest & 3)) {
    four = rest / 4;
    for (i = 0; i < four; i++) printf("4");
    for (i = 0; i < seven; i++) printf("7");
    puts("");
  } else {
    seven--;
    rest += 7;
    if (rest > n)
      puts("-1");
    else {
      if (!(rest & 3)) {
        four = rest / 4;
        for (i = 0; i < four; i++) printf("4");
        for (i = 0; i < seven; i++) printf("7");
        puts("");
      } else {
        seven--;
        rest += 7;
        if (rest > n)
          puts("-1");
        else {
          if (!(rest & 3)) {
            four = rest / 4;
            for (i = 0; i < four; i++) printf("4");
            for (i = 0; i < seven; i++) printf("7");
            puts("");
          } else {
            seven--;
            rest += 7;
            if (rest > n)
              puts("-1");
            else {
              if (!(rest & 3)) {
                four = rest / 4;
                for (i = 0; i < four; i++) printf("4");
                for (i = 0; i < seven; i++) printf("7");
                puts("");
              } else
                puts("-1");
            }
          }
        }
      }
    }
  }
  return 0;
}
