#include <bits/stdc++.h>
using namespace std;
const long long lim = 1e18;
int n;
int getint() {
  char ch;
  int ret = 0, p;
  while (!isdigit(ch = getchar()) && ch != '-')
    ;
  p = ch == '-' ? ch = getchar(), -1 : 1;
  while (isdigit(ch)) ret = (ret << 3) + (ret << 1) + (ch ^ 48), ch = getchar();
  return ret * p;
}
int main() {
  n = getint();
  long long now = 0, base = 1;
  bool flag = true;
  while (n && flag) {
    if (n >= 2) {
      now += base * 8;
      n -= 2;
    } else {
      now += base * 4;
      n--;
    }
    if (now > lim) {
      flag = false;
      break;
    }
    base *= 10;
  }
  if (flag)
    cout << now << endl;
  else
    cout << -1 << endl;
  return 0;
}
