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