#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  int k;
  while (cin >> k) {
    if (k > 36)
      cout << "-1" << endl;
    else if (k == 1)
      cout << "6" << endl;
    else if (k == 2)
      cout << "8" << endl;
    else if (k == 3)
      cout << "86" << endl;
    else if (k == 4)
      cout << "88" << endl;
    else if (k == 5)
      cout << "886" << endl;
    else if (k == 6)
      cout << "888" << endl;
    else if (k == 7)
      cout << "8886" << endl;
    else if (k == 8)
      cout << "8888" << endl;
    else if (k == 9)
      cout << "88886" << endl;
    else if (k == 10)
      cout << "88888" << endl;
    else if (k == 11)
      cout << "888886" << endl;
    else if (k == 12)
      cout << "888888" << endl;
    else if (k == 13)
      cout << "8888886" << endl;
    else if (k == 14)
      cout << "8888888" << endl;
    else if (k == 15)
      cout << "88888886" << endl;
    else if (k == 16)
      cout << "88888888" << endl;
    else if (k == 17)
      cout << "888888886" << endl;
    else if (k == 18)
      cout << "888888888" << endl;
    else if (k == 19)
      cout << "8888888886" << endl;
    else if (k == 20)
      cout << "8888888888" << endl;
    else if (k == 21)
      cout << "88888888886" << endl;
    else if (k == 22)
      cout << "88888888888" << endl;
    else if (k == 23)
      cout << "888888888886" << endl;
    else if (k == 24)
      cout << "888888888888" << endl;
    else if (k == 25)
      cout << "8888888888886" << endl;
    else if (k == 26)
      cout << "8888888888888" << endl;
    else if (k == 27)
      cout << "88888888888886" << endl;
    else if (k == 28)
      cout << "88888888888888" << endl;
    else if (k == 29)
      cout << "888888888888886" << endl;
    else if (k == 30)
      cout << "888888888888888" << endl;
    else if (k == 31)
      cout << "8888888888888886" << endl;
    else if (k == 32)
      cout << "8888888888888888" << endl;
    else if (k == 33)
      cout << "88888888888888886" << endl;
    else if (k == 34)
      cout << "88888888888888888" << endl;
    else if (k == 35)
      cout << "888888888888888886" << endl;
    else if (k == 36)
      cout << "888888888888888888" << endl;
  }
}
