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