#include <bits/stdc++.h>
using namespace std;
int main() {
  int n = 0, i = 0;
  cin >> n;
  vector<int> v;
  while (n >= 4 && n % 7 != 0) {
    n -= 4;
    i++;
  }
  if (n % 7 != 0)
    cout << "-1" << endl;
  else {
    int h = n / 7;
    while (i != 0) {
      v.push_back(4);
      --i;
    }
    while (h != 0) {
      v.push_back(7);
      --h;
    }
    for (int i = 0; i < v.size(); i++) cout << v[i];
  }
  return 0;
}
