#include <bits/stdc++.h>
int main() {
  int n;
  scanf("%d", &n);
  int n1 = n / 7, n2 = n % 7;
  while (n2 % 4) {
    n2 += 7;
    --n1;
  }
  if (n1 < 0) {
    printf("-1");
  } else {
    for (int i = 0; i < n2 / 4; ++i) putchar('4');
    for (int i = 0; i < n1; ++i) putchar('7');
  }
}
