#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int low = n / 7;
  int high = n / 4 + 1;
  int i, j, f = 0;
  if (low * 7 == n) {
    for (int k = 0; k < low; k++) cout << "7";
    return 0;
  }
  for (i = low + 1; i <= high; i++) {
    int guess = 4 * i;
    for (j = 0; j <= i; j++) {
      if (guess == n) {
        f = 1;
        break;
      }
      guess += 3;
    }
    if (f == 1) break;
  }
  if (f != 1)
    cout << "-1" << endl;
  else {
    for (int k = 0; k < i - j; k++) cout << "4";
    for (int k = 0; k < j; k++) cout << "7";
  }
}
