#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-6;
const int INF = 1e9 + 7;
const int N = 1e5 + 10;
int n, m, k, t;
int main() {
  scanf("%d", &n);
  int a, b = n / 7;
  bool f = false;
  while (1) {
    int tmp = n - 7 * b;
    if (tmp % 4 == 0) {
      a = tmp / 4;
      f = true;
      break;
    }
    b--;
    if (b < 0) break;
  }
  if (!f)
    puts("-1");
  else {
    while (a--) printf("4");
    while (b--) printf("7");
  }
  return 0;
}
