#include <bits/stdc++.h>
using namespace std;
int main() {
  long n, b, aa, bb = 0, res = 10000001;
  bool found = false;
  cin >> n;
  for (b = 0; (7 * b) <= n; ++b) {
    long a = n - (7 * b);
    if (a % 4 == 0) {
      res = min(res, (a / 4) + b);
      if (res == (a / 4) + b) {
        bb = b;
        aa = res - b;
        found = true;
      }
    }
  }
  if (found) {
    for (long i = 0; i < aa; ++i) cout << "4";
    for (long i = 0; i < bb; ++i) cout << "7";
  } else
    cout << "-1" << endl;
  return 0;
}
