#include <bits/stdc++.h>
using namespace std;
int dp[1000005];
int pa[1000005];
int n;
int solve(int n) {
  if (n == 0) return 0;
  if (n < 0) return 1 << 30;
  if (dp[n] != -1) return dp[n];
  int l = 1 << 30;
  int a = solve(n - 4) + 1;
  int b = solve(n - 7) + 1;
  if (b < l) {
    l = b;
    pa[n] = 7;
  }
  if (a <= l) {
    l = a;
    pa[n] = 4;
  }
  return dp[n] = l;
}
int main() {
  memset(dp, -1, sizeof(dp));
  memset(pa, -1, sizeof(pa));
  scanf("%d", &n);
  int ret = solve(n);
  if (ret >= 1 << 30)
    printf("-1\n");
  else {
    while (n != 0) {
      int num = pa[n];
      printf("%d", num);
      n -= num;
    }
    printf("\n");
  }
}
