#include <bits/stdc++.h>
using namespace std;
struct __timestamper {};
const int md = 1000000007;
int main(void) {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < 1000000; ++i) {
    int x = n - 4 * i;
    if (x >= 0 && x % 7 == 0) {
      for (int j = 0; j < i; ++j) {
        putchar('4');
        n -= 4;
      }
      while (n > 0) putchar('7'), n -= 7;
      return 0;
    }
  }
  puts("-1");
  return 0;
}
