#include <bits/stdc++.h>
using namespace std;
int main() {
  long long i, n, flag = 0, no_digit, ans = 999999999, four, seven;
  cin >> n;
  long long pp = n / 7;
  for (i = pp; i >= 0; i--) {
    if ((n - (7 * i)) % 4 == 0) {
      flag = 1;
      no_digit = i + (n - (7 * i)) / 4;
      if (no_digit <= ans) {
        ans = no_digit;
        four = (n - (7 * i)) / 4;
        seven = i;
      }
    }
  }
  if (flag) {
    for (i = 0; i < four; i++) cout << "4";
    for (i = 0; i < seven; i++) cout << "7";
  } else
    cout << "-1";
}
