#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n;
  cin >> n;
  string s = "";
  while (n > 0) {
    if (n % 7 == 0)
      s += '7', n -= 7;
    else
      s += '4', n -= 4;
  }
  if (n < 0)
    cout << -1;
  else
    cout << s;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  solve();
  cout << "\n";
  cerr << "time taken : " << (float)clock() / CLOCKS_PER_SEC << " secs" << endl;
  return 0;
}
