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