#include <bits/stdc++.h>
using namespace std;
int n;
int main() {
  int a = -1, b = -1, res = (1e9 + 7);
  scanf("%d", &n);
  for (int i = 0; i * 7 <= n; i++) {
    int tmp = n - i * 7;
    if (tmp % 4 == 0) {
      if (res > i + tmp / 4) {
        res = i + tmp / 4;
        a = i;
        b = tmp / 4;
      }
    }
  }
  if (a == -1)
    printf("-1\n");
  else {
    for (int i = 1; i <= b; i++) printf("4");
    for (int i = 1; i <= a; i++) printf("7");
    puts("");
  }
  return 0;
}
