#include <bits/stdc++.h>
using namespace std;
string check(int n, int i, string s, int number_of_seven) {
  if (i >= 4 && i < 7) {
    s.insert(0, "4");
    return check(n, i - 4, s, number_of_seven);
  } else if (i == 3) {
    if (number_of_seven >= 6) {
      s.insert(0, "4");
      s.insert(0, "4");
      s.insert(0, "4");
      s.insert(0, "4");
      s.insert(0, "4");
      s.insert(0, "4");
      s.pop_back();
      s.pop_back();
      s.pop_back();
      return s;
    }
    string no = "-1";
    return no;
  } else if (i == 2) {
    s.insert(0, "4");
    s.insert(0, "4");
    s.insert(0, "4");
    s.insert(0, "4");
    s.pop_back();
    s.pop_back();
    return s;
  } else if (i == 1) {
    s.insert(0, "4");
    s.insert(0, "4");
    s.pop_back();
    return s;
  } else if (i == 0) {
    return s;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  string ans = "";
  if (n < 4) {
    cout << -1;
    return 0;
  } else if (n == 4) {
    cout << "4";
    return 0;
  } else if (n < 7 || n == 9 || n == 10) {
    cout << -1;
    return 0;
  }
  int number_of_seven = n / 7;
  for (int i = 0; i < number_of_seven; i++) {
    ans.push_back('7');
  }
  int remainder = n % 7;
  if (remainder != 0)
    cout << check(n, remainder, ans, number_of_seven);
  else
    cout << ans;
  return 0;
}
