#include <bits/stdc++.h>
int main() {
  int i, n, four1 = 0, seven1 = 0, four = 0, seven = 0, y, flag1 = -1,
            flag2 = -1, l = 0, flag = -1;
  scanf("%d", &n);
  y = n;
  if (n % 4 == 0) {
    flag1 = 1;
    four1 = n / 4;
  }
  if (n % 7 == 0) {
    flag2 = 1;
    seven1 = n / 7;
  }
  if (flag1 == 1 && flag2 == 1) {
    if (four1 < seven1) {
      for (i = 0; i < four1; i++) printf("4");
    } else {
      for (i = 0; i < seven1; i++) printf("7");
    }
    return 0;
  }
  for (;;) {
    y = y - 4;
    four++;
    if (y % 7 == 0) {
      seven += y / 7;
      break;
    }
    if (y < 4) {
      flag = 1;
      break;
    }
  }
  l = seven + four;
  if (flag == 1 && seven1 == 0 && four1 == 0) {
    printf("-1");
  } else {
    if (seven1 > 0 && four1 > 0 && l > 0) {
      if (l < four1 && l < seven1) {
        for (i = 0; i < four; i++) printf("4");
        for (i = 0; i < seven; i++) printf("7");
      }
    } else if (four1 > 0 && seven1 == 0) {
      if (l < four1) {
        for (i = 0; i < four; i++) printf("4");
        for (i = 0; i < seven; i++) printf("7");
      } else {
        for (i = 0; i < four1; i++) printf("4");
      }
    } else if (seven1 > 0 && four1 == 0) {
      if (l < seven1) {
        for (i = 0; i < four; i++) printf("4");
        for (i = 0; i < seven; i++) printf("7");
      } else {
        for (i = 0; i < seven1; i++) printf("7");
      }
    } else if (l > 0 && four1 == 0 && seven1 == 0) {
      for (i = 0; i < four; i++) printf("4");
      for (i = 0; i < seven; i++) printf("7");
    }
  }
  return 0;
}
