#include <bits/stdc++.h>
using namespace std;
int main() {
  string res = "";
  int sf = 100000000, cf = 100000000, s, c;
  int N;
  cin >> N;
  for (int i = 0; i < 200000; ++i) {
    if ((N - 7 * i) >= 0 && (N - 7 * i) % 4 == 0) {
      s = i;
      c = (N - 7 * i) / 4;
      if (s + c < sf + cf) {
        sf = s;
        cf = c;
      }
    }
  }
  if ((sf + cf) < 200000000) {
    for (int i = 0; i < cf; ++i) {
      res.push_back('4');
    }
    for (int i = 0; i < sf; ++i) {
      res.push_back('7');
    }
    cout << res << endl;
  } else {
    cout << -1 << endl;
  }
  return 0;
}
