#include <bits/stdc++.h>
using namespace std;
#pragma optimize("-O3")
void autocheck() {}
void fast() {
  cin.tie(NULL);
  cout.tie(NULL);
  ios_base::sync_with_stdio(false);
}
const long long sz = 1e9 + 7;
const long long MAXN = 200007;
long long factorial[MAXN];
void calc_factorial() {
  factorial[0] = 1;
  for (int i = 1; i <= MAXN; i++) {
    factorial[i] = ((factorial[i - 1] * i) % sz);
  }
}
long long sm(long long x, long long y) { return ((x + y) % sz); }
long long md2(long long x, long long y) { return ((x * y) % sz); }
long long md3(long long x, long long y, long long z) {
  return md2(x, md2(y, z));
}
int gcd(int n, int m) {
  if (n == 0) return m;
  return gcd(m % n, n);
}
long long fpow(long long a, long long b) {
  a = a % sz;
  if (b == 0)
    return 1;
  else if (b % 2 == 1) {
    long long temp = fpow(a, (b - 1) / 2);
    return md3(a, temp, temp);
  } else {
    long long temp = fpow(a, b / 2);
    return md2(temp, temp);
  }
}
long long modInverse(long long a) { return fpow(a, sz - 2); }
long long MODnCk(long long n, long long k) {
  return md3(factorial[n], modInverse(factorial[n - k]),
             modInverse(factorial[k]));
}
int main() {
  autocheck();
  fast();
  int t = 1;
  while (t--) {
    int n;
    cin >> n;
    bool f = 0;
    int i = 0;
    while (i <= n) {
      if ((n - i) % 7 == 0) {
        f = 1;
        break;
      }
      i += 4;
    }
    if (!f)
      cout << -1 << endl;
    else {
      for (long long j = 0; j < i / 4; j++) cout << 4;
      for (long long j = 0; j < (n - i) / 7; j++) cout << 7;
    }
  }
}
