#include <bits/stdc++.h>
using namespace std;
long long oo = 1e18;
int const M = 1e9 + 7;
int n, m, k;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n;
  int c4 = 0, c7 = 0;
  for (int i = n; i >= 0 && n % 7; n -= 4) c4++;
  if (n < 0) return puts("-1"), 0;
  c7 = n / 7;
  while (c4--) cout << 4;
  while (c7--) cout << 7;
  return 0;
}
