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