#include <bits/stdc++.h>
using namespace std;
const int INF = (int)(INT_MAX / 2);
const int N = (int)(0);
const long long mod = (int)(1e+9 + 7);
int n, m, a, b, x, y, s;
int main() {
  scanf("%d", &n);
  y = n / 7;
  for (int i = y; i >= 0; i--) {
    if ((n - 7 * y) % 4 != 0) {
      y--;
      continue;
    }
    for (int j = 0; j < (n - 7 * y) / 4; j++) cout << 4;
    for (int j = 0; j < y; j++) cout << 7;
    return 0;
  }
  printf("%d\n", -1);
  return 0;
}
