#include <bits/stdc++.h>
int main() {
  long int n;
  scanf("%ld", &n);
  int I = 0, k;
  while ((k = (n - 4 * I)) % 7 > 0) I++;
  if (k >= 0 && k % 7 == 0) {
    k /= 7;
    while (I--) putchar('4');
    while (k--) putchar('7');
  } else
    printf("-1");
  return 0;
}
