#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < 100000; i++) {
    if (n - (4 * i) >= 0 && (n - (4 * i)) % 7 == 0) {
      int j = (n - (4 * i)) / 7;
      for (int k = 0; k < i; k++) printf("4");
      for (int k = 0; k < j; k++) printf("7");
      return 0;
    }
  }
  cout << "-1\n";
}
