import java.awt.*;
import java.awt.event.*;
class AwtD extends Frame implements WindowListener {
    public static void main(String[] arg) {
        new AwtD();
    }
    AwtD() {
        addWindowListener(this);
        setVisible(true);
    }
    public void windowActivated(WindowEvent e) { }
    public void windowDeactivated(WindowEvent e) { }
    public void windowIconified(WindowEvent e) { }
    public void windowDeiconified(WindowEvent e) { }
    public void windowOpened(WindowEvent e) { }
    public void windowClosed(WindowEvent e) { }
    public void windowClosing(WindowEvent e) {
        System.exit(0);
    }
}

// cannot extend Frame & WindowAdapter at the same time

