#include <bits/stdc++.h>
using namespace std;
vector<int> ans, ans1;
int f(int n, int p) {
  int a = p;
  while (n > 0) {
    if (p == 4)
      ans.push_back(a);
    else
      ans1.push_back(a);
    n -= a;
    if (n % 4 == 0) a = 4;
    if (n % 7 == 0) a = 7;
  }
  return n;
}
void write(vector<int> &A) {
  for (size_t i = 0; i < A.size(); ++i) {
    cout << A[i];
  }
  cout << endl;
}
int n;
int main() {
  cin >> n;
  int a = f(n, 4);
  int b = f(n, 7);
  if (a == 0 && b == 0 && ans.size() > ans1.size()) {
    write(ans1);
    return 0;
  }
  if (a == 0 && b == 0 && ans.size() <= ans1.size()) {
    write(ans);
    return 0;
  }
  if (a == 0 && b != 0) {
    write(ans);
    return 0;
  }
  if (a != 0 && b == 0) {
    write(ans1);
    return 0;
  }
  if (a != 0 && b != 0) {
    cout << -1 << endl;
  }
  return 0;
}
