#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int x = -1;
  for (int i = 0; i <= n / 7; i++) {
    if ((n - 7 * i) % 4 == 0) {
      x = i;
    }
  }
  if (x == -1) {
    cout << x << endl;
  } else {
    int four = n - 7 * x;
    int loop = four / 4;
    for (int i = 0; i < loop; i++) {
      cout << 4;
    }
    for (int i = 0; i < x; i++) {
      cout << 7;
    }
  }
}
