import java.util.*;
import java.io.*;

public class holes_al {
  static final int MaxN = 510;
  static int rInt (String s, int a, int b) {
    int x = Integer.parseInt (s);
    if (x < a || x > b) throw new RuntimeException (x + " is not within " + a + ".." + b);
    return x;
  };
  public static void main (String args []) throws Exception {
    Scanner in = new Scanner (System.in);
    PrintWriter out = new PrintWriter (System.out);
    int n = rInt (in.next (), 0, MaxN);
    if (in.hasNext ()) throw new Exception ("EOF expected");
    if (n == 0) out.println (1); else 
    if (n == 1) out.println (0); else {
      if (n % 2 == 1) {
        out.print (4);
        --n;
      };
      for (int i = 0; i < (n >> 1); i++)
        out.print (8);
      out.println ();
    };

    out.close ();
  };
};