#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 6e4;
int n, a[N], tot;
bool flag;
int main() {
  scanf("%d", &n);
  tot = 0;
  memset(a, 0, sizeof(a));
  for (int i = n / 7; i >= 0; i--)
    if ((n - i * 7) % 4 == 0) {
      for (int j = 1; j <= i; j++) a[++tot] = 7;
      for (int j = 1; j <= (n - i * 7) / 4; j++) a[++tot] = 4;
      flag = true;
      break;
    }
  if (!flag)
    printf("-1");
  else {
    for (int i = tot; i; i--) printf("%d", a[i]);
  }
  return 0;
}
