#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, l1, l2;
  cin >> n;
  l1 = l2 = 1000000;
  for (int i = 0; i <= n / 7; i++) {
    if ((n - i * 7) % 4 == 0) {
      int x = (n - i * 7) / 4;
      if ((l1 + l2 > x + i) || (((l1 + l2) == (x + i)) && (l1 > x))) {
        l1 = x;
        l2 = i;
      }
    }
  }
  if (l1 == 1000000) {
    cout << -1;
  } else {
    while (l1--) cout << 4;
    while (l2--) cout << 7;
  }
  return 0;
}
