#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  while (cin >> n) {
    int fourcount = 0;
    bool flag = true;
    while (n % 7 != 0 && n >= 0) {
      n = n - 4;
      fourcount++;
    }
    if (n >= 0) {
      int sevenCount = n / 7;
      while (fourcount--) {
        cout << 4;
      }
      while (sevenCount--) {
        cout << 7;
      }
      cout << '\n';
    } else
      cout << -1 << '\n';
  }
  return 0;
}
