#include <bits/stdc++.h>
using namespace std;
int main() {
  int cnt = 0, x, t, f = 0, s = 0;
  scanf("%d", &x);
  f = ceil(x / 4.0);
  t = f * 4;
  if (t - x > f / 2)
    printf("-1");
  else {
    int j;
    s = t - x;
    f -= s * 2;
    while (f >= 7) f -= 7, s += 4;
    while (f--) printf("4");
    while (s--) printf("7");
  }
  return 0;
}
