#include <bits/stdc++.h>
int main(void) {
  char s[1000001] = "";
  int n, n2, x, y, i;
  scanf("%d", &n);
  n2 = (n / 7) * 7;
  while (n2 >= 0) {
    if ((n - n2) % 4 == 0)
      break;
    else
      n2 = n2 - 7;
  }
  if (n2 < 0)
    printf("-1\n");
  else {
    y = n2 / 7;
    x = (n - n2) / 4;
    for (i = 0; i < x; i++) printf("%c", '4');
    for (i = 0; i < y; i++) printf("%c", '7');
    printf("\n");
  }
  return 0;
}
