#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  cin >> n;
  int sevens = n / 7;
  while (sevens > 0 && ((n - (sevens * 7)) % 4) != 0) sevens--;
  int fours = (n - sevens * 7) / 4;
  if (n - sevens * 7 - fours * 4 == 0) {
    for (int i = 0; i < fours; i++) cout << "4";
    for (int i = 0; i < sevens; i++) cout << "7";
  } else {
    cout << "-1";
  }
  cout << "\n";
}
int main(int argc, char const *argv[]) {
  ios_base::sync_with_stdio(false);
  cin.tie(0), cout.tie(0);
  solve();
}
