#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int curlen = n, c4 = n;
  bool f = 0;
  for (int i = 0; i <= n / 7; ++i) {
    if ((n - 7 * i) % 4 == 0) {
      f = 1;
      int x = (n - 7 * i) / 4;
      if (x + i < curlen) {
        curlen = x + i;
        c4 = x;
      } else if (x + i == curlen && x < c4)
        c4 = x;
    }
  }
  if (!f)
    cout << "-1\n";
  else {
    string r(c4, '4');
    r += string(curlen - c4, '7');
    cout << r << "\n";
  }
  return 0;
}
