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