#include <bits/stdc++.h>
using namespace std;
long long int number(deque<int> v) {
  long long int ret = 0;
  for (int i = 0; i < v.size(); ++i) {
    ret = ret * 10 + v[i];
  }
  return ret;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  deque<int> v;
  int k = n;
  while (1 && k) {
    if (v.empty()) {
      v.push_front(4);
    } else {
      if (v.front() == 4) {
        v.pop_front();
        v.push_front(8);
      } else {
        v.push_front(4);
      }
    }
    if (k > 0 && number(v) > 1000000000000000000) {
      cout << -1 << endl;
      return 0;
    }
    k--;
  }
  if (!k) {
    for (auto i : v) {
      cout << i;
    }
    cout << endl;
  }
  return 0;
}
