#include <bits/stdc++.h>
using namespace std;
long long tests;
long long binpow(long long int qaz, long long int zxc) {
  if (zxc == 0) return 1;
  if (zxc % 2 == 1)
    return binpow(qaz, zxc - 1) * qaz;
  else {
    long long int asd = binpow(qaz, zxc / 2);
    return asd * asd;
  }
}
long long n, k = -1;
int main() {
  scanf("%I64d", &n);
  for (int i = 0; i <= (n / 4); i++) {
    if ((n - (i * 4)) % 7 == 0) {
      k = i;
      break;
    }
  }
  if (k == -1) return printf("-1"), 0;
  while (k--) cout << 4, n -= 4;
  while (n > 0) cout << 7, n -= 7;
}
