#include <bits/stdc++.h>
using namespace std;
int main() {
  char a[1000000];
  long long n;
  int i = 0;
  int flag = 0;
  cin >> n;
  while (n > 0) {
    if (n % 7 == 0) {
      a[i] = '7';
      flag = 1;
      n = n - 7;
    } else {
      a[i] = '4';
      n = n - 4;
    }
    i++;
  }
  a[i] = '\0';
  if (flag == 0 && n != 0) {
    cout << "-1";
  } else {
    cout << a;
  }
  return 0;
}
