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