#include <bits/stdc++.h>
using namespace std;
int check(int a, int p) {
  if (a == 0) return 0;
  if (a == 1) return -1;
  int count = 0;
  while (a > 1) {
    cout << a << "  ";
    if (a % p != 0)
      return -1;
    else
      a = a / 4;
    count++;
  }
  return count;
}
int main() {
  int n, i, found = 1;
  int a, b;
  cin >> n;
  a = 0;
  while (1) {
    if ((n - 4 * a) < 0) {
      cout << "-1\n";
      break;
    }
    if ((n - 4 * a) % 7 == 0) {
      b = (n - 4 * a) / 7;
      for (i = 0; i < a; i++) cout << "4";
      for (i = 0; i < b; i++) cout << "7";
      cout << "\n";
      break;
    }
    a++;
  }
}
