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