#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  int n;
  cin >> n;
  int a = 0, aa, b = 0, bb;
  int min_sum = INT_MAX;
  for (aa = 0; aa < n / 4 + 1; aa++) {
    if ((n - 4 * aa) % 7 == 0) {
      bb = (n - 4 * aa) / 7;
      if (aa + bb < min_sum) {
        min_sum = aa + bb;
        a = aa;
        b = bb;
      }
    }
  }
  if (a == 0 && b == 0)
    cout << -1 << "\n";
  else {
    for (int i = 0; i < a; i++) cout << 4;
    for (int i = 0; i < b; i++) cout << 7;
    cout << "\n";
  }
  return 0;
}
