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