#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int y = n % 7, s = n / 7, f = 0;
  while (y % 4 != 0 && y <= n) {
    cerr << y << " " << s << " " << f << endl;
    y += 7, s--;
  }
  if (y > n) {
    cout << -1 << endl;
    return 0;
  }
  f = y / 4;
  if (s * 7 + f * 4 == n) {
    for (int i = 1; i <= f; i++) cout << 4;
    for (int i = 1; i <= s; i++) cout << 7;
    cout << endl;
  } else
    cout << -1 << endl;
  return 0;
}
