#include <bits/stdc++.h>
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("O3")
#pragma GCC target("avx")
const long double pi = 3.1415926535898;
using namespace std;
long long int tree[1000005];
long long int tri[1000005];
long long int n;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int n, a = 0, b = 0, c;
  cin >> n;
  bool flag = 0;
  while (n > 0) {
    if (n % 7 == 0) {
      b = n / 7;
      c = a;
      flag = 1;
      break;
    }
    n -= 4;
    a++;
  }
  if (n == 0) {
    while (a--) cout << "4";
    exit(0);
  }
  if (n < 0 && flag == 0) {
    cout << "-1";
    exit(0);
  } else {
    while (c--) cout << "4";
    while (b--) cout << "7";
  }
  return 0;
}
