#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int i = 0, maxi = -1;
  while (n - (7 * i) >= 0) {
    if ((n - (7 * i)) % 4 == 0) maxi = i;
    i++;
  }
  if (maxi == -1)
    cout << -1;
  else {
    int j = (n - (7 * maxi)) / 4;
    while (j--) cout << 4;
    while (maxi--) cout << 7;
  }
}
