#include <bits/stdc++.h>
using namespace std;
int d, x, y;
void extendedEuclid(int A, int B) {
  if (B == 0) {
    d = A;
    x = 1;
    y = 0;
  } else {
    extendedEuclid(B, A % B);
    int temp = x;
    x = y;
    y = temp - (A / B) * y;
  }
}
int main() {
  int n;
  cin >> n;
  while (true) {
    if (n < 0) {
      cout << "-1" << endl;
      return 0;
    }
    if (n % 7 == 0) {
      y = n / 7;
      break;
    }
    n -= 4;
    x++;
  }
  for (int i = 0; i < x; i++) cout << "4";
  for (int i = 0; i < y; i++) cout << "7";
  cout << endl;
}
