#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,fma")
#pragma GCC optimize("unroll-loops")
using namespace std;
long long MOD9 = 998244353;
long long MOD = 1000000007;
double eps = 1e-12;
void solve() {
  int n;
  cin >> n;
  int f = 0;
  while (f * 4 <= n) {
    if ((n - f * 4) % 7 == 0) break;
    f++;
  }
  if (f * 4 > n)
    cout << -1;
  else {
    for (int i = 0; i < f; i++) cout << 4;
    for (int i = 0; i < (n - f * 4) / 7; i++) cout << 7;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  { solve(); }
  return 0;
}
