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