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