#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  while (scanf("%d", &n) == 1) {
    int m = n % 7;
    if (n < 4) {
      printf("-1\n");
    } else if (m == 0) {
      int p = n / 7;
      for (int i = 1; i <= p; i++) {
        printf("7");
      }
      printf("\n");
    } else if (m == 1) {
      n = n - 8;
      printf("44");
      int p = n / 7;
      for (int i = 1; i <= p; i++) printf("7");
      printf("\n");
    } else if (m == 2 && n >= 16) {
      n = n - 16;
      printf("4444");
      int p = n / 7;
      for (int i = 1; i <= p; i++) printf("7");
      printf("\n");
    } else if (m == 3 && n >= 24) {
      n = n - 24;
      printf("444444");
      int p = n / 7;
      for (int i = 1; i <= p; i++) printf("7");
      printf("\n");
    } else if (m == 4) {
      n = n - 4;
      printf("4");
      int p = n / 7;
      for (int i = 1; i <= p; i++) printf("7");
      printf("\n");
    } else if (m == 5 && n >= 12) {
      n = n - 12;
      printf("444");
      int p = n / 7;
      for (int i = 1; i <= p; i++) printf("7");
      printf("\n");
    } else if (m == 6 && n >= 20) {
      n = n - 20;
      printf("44444");
      int p = n / 7;
      for (int i = 1; i <= p; i++) printf("7");
      printf("\n");
    } else
      printf("-1\n");
    return 0;
  }
}
