#include <bits/stdc++.h>
using namespace std;
int di[8] = {1, -1, 0, 0, 1, 1, -1, -1};
int dj[8] = {0, 0, 1, -1, 1, -1, 1, -1};
const int N = 5e5 + 5, MOD = 1e9 + 7;
const double PI = 3.141592653589793238;
int i, four, n, seven = -1;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (i = 0; i <= n; i += 7)
    if ((n - i) % 4 == 0) seven = i;
  if (seven == -1) return !(cout << "-1");
  four = n - seven;
  for (i = 0; i < four / 4; i++) cout << "4";
  for (i = 0; i < seven / 7; i++) cout << "7";
  return 0;
}
