#include <bits/stdc++.h>
using namespace std;
string s, mn = "";
int main() {
  int n;
  cin >> n;
  if (n % 7 == 0) {
    for (int i = 0; i < n / 7; i++) cout << "7";
    return 0;
  }
  for (int i = 0; i <= 6; i++)
    for (int j = 0; j <= (n - i * 4) / 7; j++) {
      if ((i * 4 + j * 7) == n) {
        s = "";
        for (int k = 0; k < i; k++) s += '4';
        for (int k = 0; k < j; k++) s += '7';
        if (mn == "")
          mn = s;
        else {
          if (s.size() < mn.size())
            mn = s;
          else if (s.size() == mn.size())
            mn = min(mn, s);
        }
      }
    }
  if (mn == "")
    cout << -1;
  else
    cout << mn << " ";
  return 0;
}
