#include <bits/stdc++.h>
using namespace std;
const int INF = 2e9;
const int MOD = 1e9 + 7;
vector<long long> vector_input(long long n) {
  vector<long long> v;
  for (long long i = 0; i < n; i++) {
    long long num;
    cin >> num;
    v.push_back(num);
  }
  return v;
}
void input() {
  long long n;
  cin >> n;
  long long b = n / 7 + 1;
  long long num = INT_MAX;
  long long a1, b1;
  for (long long i = 0; i <= b; i++) {
    long long a = n - i * 7;
    if (a < 0) continue;
    if (a % 4 == 0) {
      a = a / 4;
      if (num > a + i) {
        num = a + i;
        a1 = a;
        b1 = i;
      }
    }
  }
  if (num == INT_MAX)
    cout << -1 << '\n';
  else {
    for (long long i = 0; i < a1; i++) cout << 4;
    for (long long i = 0; i < b1; i++) cout << 7;
  }
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  cout.precision(12);
  input();
}
