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