#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e3 + 5;
const int mod = 1e9 + 7;
const int INF = 0x3f3f3f3f;
int n, m;
char ns[105][105];
bool cnt[30];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0), cout.tie(0);
  cin >> n;
  long long x = 0, y = 0, my = mod;
  int mi = mod;
  for (y = 0; y * 7 <= n; y++) {
    x = (n - y * 7) / 4;
    if (x * 4 + y * 7 == n) {
      if (mi > x + y) {
        mi = x + y, my = y;
      }
    }
  }
  if (mi == mod) {
    cout << -1;
    return 0;
  }
  for (int i = 1; i <= mi - my; i++) {
    cout << "4";
  }
  for (int i = 1; i <= my; i++) {
    cout << "7";
  }
  return 0;
}
