#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  int x4 = 0, x7 = 0;
  int tmp = n;
  while (tmp > 0) {
    if (tmp % 7 == 0) {
      x7 = tmp;
      break;
    }
    tmp -= 4;
  }
  if (x7 == 0) {
    if (n % 4 != 0) {
      cout << "-1\n";
      return 0;
    }
  }
  x4 = n - x7;
  cerr << "x4"
       << ": " << x4 << " | "
       << "x7"
       << ": " << x7 << endl;
  ;
  while (x4 > 0) {
    cout << 4;
    x4 -= 4;
  }
  while (x7 > 0) {
    cout << 7;
    x7 -= 7;
  }
  cout << endl;
  return 0;
}
