#include <bits/stdc++.h>
using namespace std;
const int lim = 2e3 + 3;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  int ub = 1;
  while (ub * 4 <= n) ++ub;
  --ub;
  int lb = 1;
  while (lb * 7 <= n) ++lb;
  --lb;
  for (int k = lb; k <= ub; ++k)
    for (int i = k; i >= 0; --i)
      if (n == i * 4 + 7 * (k - i)) {
        cout << string(i, '4') << string(k - i, '7');
        return 0;
      }
  cout << -1;
  return 0;
}
