#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, x, y;
  cin >> n;
  x = n / 7;
  while (x != -1) {
    y = (n - 7 * x) / 4;
    if ((x * 7 + 4 * y) == n) {
      break;
    } else
      x--;
  }
  if ((x * 7 + 4 * y) == n) {
    for (int i = 0; i < y; i++) cout << 4;
    for (int i = 0; i < x; i++) cout << 7;
    cout << endl;
  } else {
    cout << -1 << endl;
  }
  return 0;
}
