#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, t = 0;
  scanf("%lld", &n);
  long long cnt = 0, cnt1 = 0;
  while (1) {
    if (t == n)
      break;
    else if (t < n) {
      t += 7;
      cnt1++;
    } else {
      break;
    }
  }
  while (1) {
    if (t == n)
      break;
    else if (t > n and cnt1 > 0) {
      cnt1--;
      t -= 7;
    } else {
      if (cnt1 == 0 and t > n)
        break;
      else {
        t += 4;
        cnt++;
      }
    }
  }
  if (t != n) {
    printf("-1\n");
    return 0;
  }
  for (long long i = 1; i <= cnt; i++) cout << "4";
  for (long long i = 1; i <= cnt1; i++) cout << "7";
  return 0;
}
