#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  bool flag = false;
  int mini = 1 << 28;
  string ans = "";
  int A, B;
  A = 0;
  B = 0;
  for (int i = 0; i <= n / 7; i++) {
    int b = i;
    int a = (n - b * 7) / 4;
    if ((a * 4) + (b * 7) == n && a >= 0 && b >= 0) {
      flag = true;
      if (mini > (a + b)) {
        mini = a + b;
        A = a;
        B = b;
      }
    }
  }
  if (!flag)
    cout << "-1" << endl;
  else {
    for (int i = 0; i < A; i++) cout << '4';
    for (int i = 0; i < B; i++) cout << '7';
    cout << endl;
  }
  return 0;
}
