#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  if (!(n % 7)) {
    int x = n / 7;
    while (x--) cout << '7';
    return 0;
  }
  int aa = -1, bb = -1;
  for (int a = 0; a < n; a++) {
    int b = (n - a * 7) / 4;
    if (b > 0)
      if (b * 4 + a * 7 == n) {
        if (aa == -1 || a + b < aa + bb || (a + b == aa + bb && aa < a)) aa = a;
        bb = b;
      }
  }
  if (aa != -1) {
    while (bb--) cout << '4';
    while (aa--) cout << '7';
  } else
    cout << -1 << endl;
  return 0;
}
