#include <bits/stdc++.h>
using namespace std;
const int N = 1e6;
int main() {
  int n;
  scanf("%d", &n);
  int i = ceil(N / 7.0), j = -1;
  for (; i >= 0; i--) {
    int l = 0, r = ceil(N / 4.0), ans = -1;
    while (l <= r) {
      int mid = (l + r) / 2;
      if ((i * 7) + (mid * 4) == n) {
        j = mid;
        break;
      } else if ((i * 7) + (mid * 4) > n)
        r = mid - 1;
      else if ((i * 7) + (mid * 4) < n)
        l = mid + 1;
    }
    if (j != -1) break;
  }
  i += (j / 7) * 4;
  j %= 7;
  if (j != -1) {
    while (j--) printf("4");
    while (i--) printf("7");
  } else
    cout << -1;
}
