#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
long long n;
void Input() { cin >> n; }
void Solve() {
  long long x = -1, y = -1;
  for (long long i = 0; i <= n; i++)
    if ((n - 7 * i) % 4 == 0 and n >= 7 * i) x = i, y = (n - 7 * i) / 4;
  if (x == -1 and y == -1)
    cout << -1;
  else {
    while (y--) cout << 4;
    while (x--) cout << 7;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long T = 1;
  while (T--) {
    Input();
    Solve();
  }
  return 0;
}
