#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n = 0, k = 0, m = 0, b = 0, k1 = 0, cnt = 0, x, y, z, d, flag = 0,
            q;
  cin >> n;
  while (n > 3 && n % 7 != 0) {
    n = n - 4;
    k++;
  }
  if (n % 7 == 0) {
    k1 = n / 7;
    for (int i = (0); i < (k); i++) cout << "4";
    for (int i = (0); i < (k1); i++) cout << "7";
  } else
    cout << "-1";
}
int main() {
  auto start = clock();
  ios_base::sync_with_stdio(0), cin.tie(NULL);
  int t = 1;
  while (t--) solve();
  auto stop = clock();
  cerr << "time taken:" << double(stop - start) / double(CLOCKS_PER_SEC) << " s"
       << "\n";
  return 0;
}
