#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string a;
  cin >> n;
  n += 700;
  while (n % 7) {
    a = '4' + a;
    n -= 4;
  }
  n -= 700;
  if (n < 0) {
    cout << "-1";
    return 0;
  }
  cout << a;
  for (int i = 1; i <= n / 7; ++i) cout << "7";
}
