#include <bits/stdc++.h>
clock_t T;
int INF = 1000000005;
long long INFF = 1000000000000000005LL;
double pi = acos(-1);
int dirx[8] = {-1, 0, 0, 1, -1, -1, 1, 1};
int diry[8] = {0, 1, -1, 0, -1, 1, -1, 1};
using namespace std;
const long long N = 1e7;
void primeFactors(long long n) {}
long long fastPower(long long b, long long p) {
  if (p == 0) return 1;
  long long ans = fastPower(b, p / 2);
  ans = (ans * ans);
  if (p % 2 != 0) ans = (ans * b);
  return ans;
}
vector<long long> factorize(long long x) {
  vector<long long> ret;
  for (int i = 2; i * i <= x; i++) {
    long long cnt = 0;
    while (x % i == 0) {
      x /= i;
      cnt++;
    }
    if (cnt) {
      ret.push_back(cnt);
    }
  }
  if (x > 1) ret.push_back(1);
  return ret;
}
long long n, k, d;
long long ans = 0;
long long mod = 1000000007;
long long add(long long a, long long b) { return (a + b) % mod; }
void lucky(long long sum) {
  if (sum <= 0) {
    if (sum == 0) {
      cout << "ok";
      return;
    }
    return;
  }
  lucky(sum - 4);
  lucky(sum - 7);
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ios_base::sync_with_stdio(0);
  long long n;
  cin >> n;
  string ans;
  while (n % 7 != 0) {
    ans += "4";
    n -= 4;
  }
  while (n != 0) {
    ans += "7";
    n -= 7;
    if (n < 0) {
      cout << -1 << endl;
      return 0;
    }
  }
  cout << ans;
  cerr << endl << "Time : " << double(clock() - T) / CLOCKS_PER_SEC << endl;
  return 0;
}
