#include <bits/stdc++.h>
using namespace std;
int n;
int main() {
  cin >> n;
  int a = 0;
  int b = 7;
  while (n >= 0) {
    if (n % 7 == 0) {
      for (int i = 0; i < a; i++) cout << 4;
      for (int i = 0; i < n / 7; i++) cout << 7;
      cout << endl;
      return 0;
    }
    n -= 4;
    a++;
  }
  cout << -1 << endl;
  return 0;
}
