#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n;
  scanf("%d", &n);
  {
    int k4 = n / 4;
    int k7 = 0;
    int r = n % 4;
    ;
    if (r == 3) {
      k4 -= 1;
      k7 += 1;
    } else if (r == 2) {
      k4 -= 3;
      k7 += 2;
    } else if (r == 1) {
      k4 -= 5;
      k7 += 3;
    }
    while (k4 >= 7) {
      k4 -= 7;
      k7 += 4;
    }
    if ((k4 > 0 || k7 > 0) && (k4 >= 0) && (k7 >= 0)) {
      for (int i = 0; i < (k4); ++i) {
        cout << 4;
      }
      for (int i = 0; i < k7; ++i) {
        cout << 7;
      }
      cout << endl;
    } else {
      cout << -1 << endl;
    }
  }
  return (0);
}
