#include <bits/stdc++.h>
using namespace std;
int main() {
  int sum;
  cin >> sum;
  int a = 0, b = 0;
  while (sum > 0) {
    if (sum % 7 == 0) {
      b++;
      sum = sum - 7;
    } else if (sum % 4 == 0) {
      a++;
      sum = sum - 4;
    } else {
      a++;
      sum = sum - 4;
    }
  }
  if (sum < 0) {
    cout << -1;
    return 0;
  }
  while (a--) {
    cout << 4;
  }
  while (b--) {
    cout << 7;
  }
  return 0;
}
