#include <bits/stdc++.h>
using namespace std;
int main() {
  int k7 = 0;
  int k4 = 0;
  int n;
  cin >> n;
  for (; 7 * k7 < n; k7++)
    ;
  while (4 * k4 + 7 * k7 != n) {
    if (4 * k4 + 7 * k7 < n)
      k4++;
    else if (k7 > 0)
      k7--;
    else
      break;
  }
  if (4 * k4 + 7 * k7 == n) {
    for (int i = 0; i < k4; i++) cout << 4;
    for (int i = 0; i < k7; i++) cout << 7;
    cout << endl;
  } else {
    cout << -1 << endl;
  }
}
