#include <bits/stdc++.h>
using namespace std;
int n, m, x, y;
int main() {
  cin >> n;
  for (int a = 0; a <= n / 4; ++a) {
    int b = (n - 4 * a) / 7;
    if (4 * a + 7 * b == n) {
      for (int i = 0; i < a; ++i) cout << "4";
      for (int i = 0; i < b; ++i) cout << "7";
      cout << "\n";
      return 0;
    }
  }
  cout << "-1\n";
  return 0;
}
