#include <bits/stdc++.h>
using namespace std;
int main() {
  int x, e, s;
  cin >> x;
  bool b = 0;
  if (x % 7 == 0) {
    for (int i = 1; i <= x / 7; i++) cout << "7";
    cout << endl;
  } else if (x < 4) {
    cout << "-1" << endl;
    return 0;
  } else if (x % 7 != 0) {
    e = x / 7 + 1;
    if ((x - (e * 4)) % 3 != 0) {
      for (int i = 1; (i + e) * 4 < x; i++) {
        if ((x - ((i + e) * 4)) % 3 == 0) {
          s = (x - ((e + i) * 4)) / 3;
          for (int j = 0; j < e + i - s; j++) cout << "4";
          for (int k = e + i - s; k < e + i; k++) cout << "7";
          cout << endl;
          return 0;
        }
      }
      b = 1;
    } else {
      s = (x - (e * 4)) / 3;
      for (int i = 0; i < e - s; i++) cout << "4";
      for (int i = e - s; i < e; i++) cout << "7";
      cout << endl;
    }
  }
  if (x % 4 == 0 && b == 1) {
    for (int i = 1; i <= x / 4; i++) cout << "4";
    cout << endl;
  } else if (b == 1)
    cout << "-1" << endl;
  return 0;
}
