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