#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, j, k, t, x, y, z, sq, n, m, ln, l, r;
  int ans = 0, ct = 0, ok = 0, sum = 0, mx = 0, mn;
  string s;
  cin >> n;
  for (i = 0; i < 250005; i++) {
    x = n - (4 * i);
    if (x < 0) break;
    if (x % 7 == 0) {
      while (i--) s += '4';
      n = x / 7;
      while (n--) s += '7';
      cout << s << endl;
      return 0;
    }
  }
  cout << "-1" << endl;
}
