#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int s = 0;
  while (n >= 7 && n % 4) {
    s++;
    n -= 7;
  }
  if (n % 4)
    cout << -1 << endl;
  else {
    int as = n / 4;
    s += (as / 7) * 4;
    as %= 7;
    while (as--) cout << 4;
    while (s--) cout << 7;
  }
  cout << endl;
  return 0;
}
