#include <bits/stdc++.h>
using namespace std;
void IOS() {
  ios::sync_with_stdio(false);
  cout.precision(10);
  cout << fixed;
}
const int MOD = 1e9 + 7;
const int mx = 1e5 + 5;
int main() {
  IOS();
  int n;
  cin >> n;
  priority_queue<pair<int, int>> pq;
  for (int i = 0; i <= n; i++) {
    if ((n - i * 7) < 0)
      break;
    else if ((n - i * 7) % 4 == 0) {
      int x = (n - i * 7) / 4;
      if (x >= 0) pq.push(make_pair(i, x));
    }
  }
  if (pq.empty())
    cout << -1 << "\n";
  else {
    auto x = pq.top();
    string s;
    for (int i = 0; i < x.second; i++) {
      s += '4';
    }
    for (int i = 0; i < x.first; i++) {
      s += '7';
    }
    cout << s << "\n";
  }
  return 0;
}
