#include <bits/stdc++.h>
using namespace std;
const int oo = (int)1e9, MAXN = (int)1e6, risk = (int)1e6;
const double eps = 1e-9;
bool valid(int n) {
  if (n == 0) return false;
  while (n) {
    if (n % 10 == 4 || n % 10 == 7) {
      n /= 10;
    } else
      return false;
  }
  return true;
}
int main() {
  int n, a, b;
  cin >> n;
  a = 11111111;
  b = 11111111;
  for (int i = (0); i <= (n / 4); i++) {
    int j = (n - 4 * i) / 7;
    if ((4 * i + 7 * j) != n) continue;
    if (i + j < a + b) a = i, b = j;
  }
  if ((4 * a + 7 * b) != n)
    cout << -1;
  else {
    for (int i = 0; i < (a); i++) cout << 4;
    for (int i = 0; i < (b); i++) cout << 7;
  }
  cout << endl;
  return 0;
}
