#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int s = n / 7, f;
  n -= 7 * s;
  f = n / 4;
  n -= 4 * f;
  if (s < n) {
    cout << -1;
    return 0;
  }
  if (n != 0) {
    s -= n;
    f += 2 * n;
  }
  string ans;
  while (f--) ans += '4';
  while (s--) ans += '7';
  cout << ans;
  return 0;
}
