#include <bits/stdc++.h>
using namespace std;
struct lucky {
  int four, seven, tot;
};
vector<lucky> s;
int n, loop;
bool cmp(lucky n1, lucky n2) {
  if (n1.tot == n2.tot)
    return n1.four > n2.four;
  else
    return n1.tot < n2.tot;
}
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  cin >> n;
  loop = n / 4;
  if (n % 4 == 0) {
    lucky temp;
    temp.four = n / 4;
    temp.seven = 0;
    temp.tot = n / 4;
    s.push_back(temp);
  }
  for (int i = 0; i <= loop; i++) {
    int num = (4 * i);
    int rem = n - num;
    if (rem % 7 == 0) {
      lucky temp;
      temp.four = i;
      temp.seven = rem / 7;
      temp.tot = temp.four + temp.seven;
      s.push_back(temp);
    }
  }
  if (!s.size()) {
    cout << -1 << endl;
    return 0;
  }
  sort(s.begin(), s.end(), cmp);
  for (int i = 0; i < s[0].four; i++) cout << 4;
  for (int i = 0; i < s[0].seven; i++) cout << 7;
  cout << endl;
  return 0;
}
