#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, last = -1;
  cin >> n;
  for (int i = 0; i <= n / 7; i++)
    if ((n - (i * 7)) % 4 == 0) last = i;
  if (last == -1) cout << -1, exit(0);
  int x = (n - (last * 7)) / 4;
  while (x--) cout << 4;
  while (last--) cout << 7;
}
