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