#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, flag = 1, i;
  cin >> n;
  int a = n / 7, b = n % 7;
  while (a >= 0) {
    if (b % 4 == 0) {
      flag = 0;
      break;
    } else {
      a -= 1;
      b += 7;
    }
  }
  if (flag)
    cout << "-1" << endl;
  else {
    for (i = 0; i < b / 4; i++) cout << "4";
    for (i = 0; i < a; i++) cout << "7";
    cout << endl;
  }
}
