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