#include <bits/stdc++.h>
int main() {
  int n;
  scanf("%d", &n);
  int f = -1, s = -1;
  for (int i = 0; i < n; i++) {
    int tmp = n - i * 7;
    if (tmp % 4 == 0 && tmp / 4 >= 0) {
      if ((f == -1 && s == -1) || (i + tmp / 4 < s + f)) {
        f = tmp / 4;
        s = i;
      }
    }
  }
  if (f == -1 && s == -1) {
    printf("-1\n");
  } else {
    for (int i = 0; i < f; i++) {
      printf("4");
    }
    for (int i = 0; i < s; i++) {
      printf("7");
    }
  }
  return 0;
}
