#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a = 0, b, x, y, i;
  scanf("%d", &n);
  while (n % 7 != 0) {
    a++;
    n -= 4;
  }
  if (n < 0) {
    cout << -1 << endl;
    return 0;
  } else {
    for (i = 0; i < a; i++) cout << 4;
    for (i = 0; i < n / 7; i++) cout << 7;
    cout << endl;
  }
  return 0;
}
