#include <bits/stdc++.h>
using namespace std;
int ac(string x) {
  int sum = 0;
  for (int i = 0; i < x.size(); i++) {
    sum += x[i] - 48;
  }
  return sum;
}
int main() {
  string a;
  stringstream s;
  long long n = 0, y = 0, x, arr[100001], sum = 0, counter7 = 0, counter4 = 0;
  bool h = true;
  cin >> x;
  n = x;
  while (sum != x) {
    if (sum < x) {
      a += '7';
      sum += 7;
    }
    if (sum > x) {
      sum -= 7;
      y = a.size();
      if (a.find('7') < 1000) {
        y = a.find('7');
        a.erase(y, 1);
      }
      sum += 4;
      a += '4';
    }
  }
  sum = ac(a);
  if (sum != n) {
    cout << "-1\n";
  } else {
    sort(a.begin(), a.end());
    cout << a << endl;
  }
  return 0;
}
