#include <bits/stdc++.h>
const double PI = acos(-1.0);
const int INF = 0x3f3f3f3f;
const double eps = 1e-8;
const int MAXN = 1e6 + 10;
const int MOD = 1e9 + 7;
const int dir[][2] = {{-1, 0}, {1, 0}, {0, -1}, {0, 1}};
const int seed = 131;
int cases = 0;
int main() {
  int n;
  scanf("%d", &n);
  int i;
  for (i = 0; i < MAXN; i++) {
    int sum = n - i * 4;
    if (sum < 0) break;
    if (sum % 7 == 0) {
      for (int j = 1; j <= i; j++) printf("4");
      for (int j = 0; j < sum / 7; j++) printf("7");
      return 0;
    }
  }
  puts("-1");
  return 0;
}
