#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int c = 0;
  while (n >= 4 && n % 7 != 0) {
    c++;
    n -= 4;
  }
  if (n % 7 == 0) {
    for (int i = 0; i < c; i++) cout << "4";
    for (int i = 0; i < n / 7; i++) cout << "7";
  } else
    cout << "-1";
}
