#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s = "";
  while (n > 0) {
    if (n % 7 == 0) {
      s += '7';
      n -= 7;
    } else if (n % 4 == 0) {
      s += '4';
      n -= 4;
    } else {
      s += '7';
      n -= 7;
    }
  }
  sort(s.begin(), s.end());
  if (n != 0) {
    cout << "-1" << endl;
  } else {
    cout << s << endl;
  }
}
