#include <bits/stdc++.h>
using namespace std;
const long long int mod = 1e9 + 7;
const long double PI = 3.141592653589793;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  long long int n;
  cin >> n;
  int t = 0, r = -1;
  while (4 * t <= n) {
    if ((n - 4 * t) % 7 == 0) {
      r = t;
      break;
    }
    t++;
  }
  string ans;
  if (r != -1)
    for (int i = 0; i < r; i++) {
      ans.push_back('4');
      n -= 4;
    }
  t = (n / 7);
  n -= (t * 7);
  for (int i = 0; i < t; i++) ans.push_back('7');
  if (n != 0)
    cout << -1;
  else
    cout << ans;
  cerr << "Time Lapsed : " << 1.0 * clock() / CLOCKS_PER_SEC << '\n';
  return 0;
}
