#include <bits/stdc++.h>
using namespace std;
int main() {
  std::ios::sync_with_stdio(false);
  long int i, n;
  cin >> n;
  long int seven = 0, four = 0;
  while (n >= 0) {
    if (n % 7 == 0) {
      seven = n / 7;
      n = 0;
      break;
    }
    n = n - 4;
    four++;
  }
  if (n == 0) {
    while (four--) cout << "4";
    while (seven--) cout << "7";
  } else {
    cout << "-1";
  }
  cout << "\n";
}
