#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 10;
const int base = 31337;
const int mod = 1e9 + 7;
const int inf = 0x3f3f3f3f;
const int logo = 20;
const int off = 1 << logo;
const int treesiz = off << 1;
int n;
int main() {
  scanf("%d", &n);
  int mina = inf, minb = inf;
  for (int i = 0; i * 4 <= n; i++) {
    if ((n - i * 4) % 7 == 0) {
      int x = (n - i * 4) / 7;
      if (i + x <= mina + minb) {
        mina = i, minb = x;
      }
    }
  }
  if (mina == inf) {
    printf("-1");
    return 0;
  }
  for (int i = 0; i < mina; i++) printf("4");
  for (int i = 0; i < minb; i++) printf("7");
  return 0;
}
