#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e6 + 3;
const int INFI = 1e9 * 2;
const long long LINFI = 1e17;
const double pi = acos(-1.0);
const int N = 1111111;
const int M = 5;
const int move[8][2] = {1, 0, -1, 0, 0, 1, 0, -1, 1, 1, 1, -1, -1, 1, -1, -1};
int a[N];
int main() {
  memset(a, 0, sizeof(a));
  for (int i = 0; i * 7 < N; i++) a[i * 7] = i;
  for (int i = 4; i < N; i++) a[i] = max(a[i], a[i - 4]);
  int n, m;
  while (scanf("%d", &n) != EOF) {
    if (n == 4)
      printf("%d\n", 4);
    else if (!a[n]) {
      if (n % 4 == 0) {
        m = n / 4;
        for (int i = 0; i < m; i++) printf("4");
        printf("\n");
      } else
        printf("%d\n", -1);
    } else {
      m = (n - a[n] * 7) / 4;
      for (int i = 0; i < m; i++) printf("4");
      for (int i = 0; i < a[n]; i++) printf("7");
      printf("\n");
    }
  }
  return 0;
}
