#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, cnt4 = 0, cnt7 = 0;
  cin >> n;
  while (n % 7 != 0 && n > 0) {
    n = n - 4;
    cnt4++;
  }
  if (n < 0)
    cout << -1;
  else {
    cnt7 = n / 7;
    for (int i = 0; i < cnt4; i++) {
      cout << 4;
    }
    for (int i = 0; i < cnt7; i++) {
      cout << 7;
    }
  }
}
