#include <bits/stdc++.h>
using namespace std;
const int INF = (int)1e9 + 10;
const int MOD = (int)1e9 + 7;
bool possible[1000001];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  string ans;
  memset(possible, false, sizeof(possible));
  possible[4] = possible[7] = true;
  for (int i = 4; i < 1000000; i++)
    if (possible[i]) possible[i + 4] = possible[i + 7] = true;
  int n;
  cin >> n;
  if (!possible[n]) return cout << -1, 0;
  while (n != 4 && n != 7) {
    if (possible[n - 7])
      ans += to_string(7), n -= 7;
    else
      ans += to_string(4), n -= 4;
  }
  ans += to_string(n);
  reverse(ans.begin(), ans.end());
  cout << ans;
  return 0;
}
