#include <bits/stdc++.h>
using namespace std;
int main(int argc, char **argv) {
  const long long nmin = 1, nmax = 1000000;
  long long n, m, mt, res, rt, i, i0, i1, j, k, t, ax;
  string s, st;
  cin >> n;
  t = nmax;
  for (i = n / 7; (i >= 0) && (t == nmax); i--) {
    m = 7 * i;
    if ((n - m) % 4 == 0) {
      i0 = (n - m) / 4;
      if (i0 + i <= t) {
        i1 = i;
        t = i0 + i1;
      }
    }
  }
  if (t == nmax)
    cout << "-1" << endl;
  else {
    s = "";
    for (i = 0; i < i0; i++) s += '4';
    for (i = i0; i < t; i++) s += '7';
    cout << s << endl;
  }
  return 0;
}
