#include <bits/stdc++.h>
using namespace std;
int par[1000100];
int num[1000100];
char a[1000100] = {'\0'};
int main() {
  memset(par, -1, sizeof(par));
  memset(num, -1, sizeof(num));
  int n;
  cin >> n;
  num[4] = 4, num[7] = 7;
  for (int i = 1; i <= n; i++)
    if (num[i] > 0) {
      if (num[i + 4] < 0) num[i + 4] = 4, par[i + 4] = i;
      if (num[i + 7] < 0) num[i + 7] = 7, par[i + 7] = i;
    }
  if (num[n] < 0)
    cout << -1;
  else {
    int idx = 0;
    while (n > 0) {
      a[idx++] = '0' + num[n];
      n = par[n];
    }
    reverse(a, a + idx);
    printf("%s", a);
  }
  return 0;
}
