#include <bits/stdc++.h>
using namespace std;
int main() {
  long int n;
  cin >> n;
  long int seven = 1000000000, four = 1000000000;
  for (long int i = n; i >= 0; i--) {
    long int p = (n - 7 * i) / 4;
    if (4 * p + 7 * i == n && i + p < four + seven && i >= 0 && p >= 0) {
      four = p;
      seven = i;
    }
  }
  if (seven == 1000000000 && four == 1000000000)
    cout << -1 << endl;
  else {
    for (long int i = 0; i < four; i++) cout << 4;
    for (long int j = 0; j < seven; j++) cout << 7;
  }
  return 0;
}
