#include <bits/stdc++.h>
using namespace std;
void findMin(int sum) {
  int a = -1, b = 0;
  for (b = sum / 7; b >= 0; b--) {
    int rem = sum - b * 7;
    if (rem % 4 == 0) {
      a = rem / 4;
      break;
    }
  }
  if (a < 0) {
    printf("-1\n");
    return;
  }
  for (int i = 0; i < a; i++) printf("4");
  for (int i = 0; i < b; i++) printf("7");
  printf("\n");
}
int main() {
  int n;
  cin >> n;
  findMin(n);
  return 0;
}
