#include <bits/stdc++.h>
using namespace std;
template <class A, class B>
ostream &operator<<(ostream &out, const pair<A, B> &a) {
  return out << "(" << a.first << "," << a.second << ")";
}
template <class A>
ostream &operator<<(ostream &out, const vector<A> &a) {
  for (const A &it : a) out << it << " ";
  return out;
}
template <class A, class B>
istream &operator>>(istream &in, pair<A, B> &a) {
  return in >> a.first >> a.second;
}
template <class A>
istream &operator>>(istream &in, vector<A> &a) {
  for (A &i : a) in >> i;
  return in;
}
long long n;
bool dp[1000005];
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  dp[0] = 1;
  for (long long i = 1; i <= 1000000; i++) {
    if (i >= 4) dp[i] |= dp[i - 4];
    if (i >= 7) dp[i] |= dp[i - 7];
  }
  cin >> n;
  if (!dp[n]) {
    cout << -1;
    return 0;
  }
  string ans = "";
  while (n) {
    if (dp[n - 7]) {
      ans += "7";
      n -= 7;
    } else {
      ans += "4";
      n -= 4;
    }
  }
  sort((ans).begin(), (ans).end());
  cout << ans;
}
