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