#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, j, s;
  cin >> n;
  for (i = 0;; ++i) {
    s = n - 4 * i;
    if (s < 0) {
      cout << -1;
      return 0;
    }
    if (s % 7 != 0) continue;
    j = s / 7;
    while (i--) cout << 4;
    while (j--) cout << 7;
    return 0;
  }
}
