#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n, i, j;
  string s = "";
  cin >> n;
  i = 0;
  j = 0;
  while (n > 0) {
    if (n % 7 == 0) {
      j = n / 7;
      n = 0;
      break;
    }
    n -= 4;
    i++;
  }
  if (n == 0) {
    while (i--) {
      cout << '4';
    }
    while (j--) {
      cout << '7';
    }
  } else {
    cout << -1 << endl;
  }
  return 0;
}
