#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, j, k, n, m;
  int x, y;
  cin >> n;
  m = n / 4;
  for (y = 0; y <= m; y++) {
    j = n - (y * 4);
    if (j % 7 == 0) break;
  }
  if (y == m + 1)
    cout << "-1\n";
  else {
    for (i = 0; i < y; i++) cout << "4";
    for (i = 0; i < (j / 7); i++) cout << "7";
    cout << "\n";
  }
}
