#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int cnt = 0;
  if (n % 7 == 0) {
    for (int i = 1; i <= n / 7; i++) cout << 7;
    cout << endl;
    return 0;
  }
  int sum = n;
  while (sum >= 0) {
    sum -= 4;
    cnt++;
    if (sum % 7 == 0) {
      for (int j = 1; j <= cnt; j++) cout << 4;
      for (int j = 1; j <= (sum / 7); j++) cout << 7;
      return 0;
    }
  }
  cout << -1 << endl;
}
