import java.io.*;

interface Strategy { public void print(int state); }          // 1. Define the interface
                                                     //    of the algorithm
class PS1 implements Strategy {
   public void print(int state) {
     state = state/10;
     for (int i = 0;i < state;i++)
      System.out.print("*");
     System.out.print(state);
   }  
}

class PS2 implements Strategy {
   public void print(int state) {
     if (state <= 10)
         for (int i = 0;i < 10;i++)
            System.out.print( Integer.toString(i)+",");
     if (state > 10 && state <= 100)
     {
         int ten_times = state/10;
         for (int i = 0;i < ten_times;i++)
            System.out.print( Integer.toString(i*10)+",");
     }
     if (state > 100)
     {
         int hund_times = state/100;
         for (int i = 0;i < hund_times;i++)
            System.out.print( Integer.toString(i*100)+",");
     }

   }  
}


class PrintFactory {
   int choice = 0;
  //returns an instance of LastFirst or FirstFirst
  //depending on whether a comma is found
  public Strategy getStrategy() {
    choice += 1;
    if (choice %2 == 1)
      return new PS1(); //return one class
    else 
		return new PS2();
  }
}