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