#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  string ans;
  while (cin >> n) {
    ans = "";
    for (int i = n / 7; i >= 0; i--) {
      if ((n - i * 7) % 4 == 0) {
        int j = (n - i * 7) / 4;
        for (int k = 0; k < j; k++) ans += "4";
        for (int k = 0; k < i; k++) ans += "7";
        break;
      }
    }
    if (ans == "")
      cout << "-1" << endl;
    else
      cout << ans << endl;
  }
  return 0;
}
