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