import java.awt.*;
import java.awt.event.*;
class ppp {
   static Frame f;
   static Button b;
   static int kkk=0;
   public static void main(String xxx[]) {
     f = new java.awt.Frame("2008");
     f.setSize(200,500);
     f.show( );  // f.hide( );
      b = new Button("HAHAHA");
     b.setBackground(Color.red);
     f.add(b, "North");
     f.validate( );  //
     f.setVisible(true);
     Button c = new Button("ccc");
     Panel p = new Panel( );
     p.add(c);
     f.add(p, "South");
     f.validate( );
     YLau mary = new YLau( b );
     c.addActionListener(mary);
     b.addActionListener(mary);  //
   }

} // class ppp
class YLau implements ActionListener {
   Button b;   int kkk=0;  int ggg=0;
   public YLau(Button b) {
      this.b = b;   ///
   }
   public void actionPerformed(ActionEvent x) {
    ggg++;
    if(x.getSource( ) == b) {
      if(ggg%2 == 1)
         b.setLabel("Happy New Year");
      else b.setLabel("Merry X'mas");
      return;
    }
    ++kkk;
    switch(kkk) {
      case 1: b.setBackground(Color.blue); 
              break;
      case 2: b.setBackground(Color.pink); break;
      case 3: b.setBackground(Color.green);break;
      default:
        System.exit(0);
    } // switch
   } // actionP...
} // class YLau