import java.applet.Applet;
import java.awt.*;
import java.awt.event.*;

public class a extends Applet implements ActionListener{

  final String[][] list={{"hello","sup"},{"hi","good morning"},{"hello","hi"}};

  TextField text=new TextField(25);
  Button click=new Button("Click here");
  TextArea message=new TextArea("Do not type in here",6,30);

  public void init() {
    setBackground(Color.white);
    text.addActionListener(this);
    add(text);
    click.addActionListener(this);
    add(click);
    message.setEditable(false);
    add(message);
  }

  public void actionPerformed(ActionEvent e) {
    boolean found=false;
    message.setText(null);
    String s=text.getText();
    for (int a=0; a<list.length; a++) {
      for (int b=0; b<list[a].length; b++) {
        if (list[a][b].equals(s.toLowerCase())) {
          message.append("\""+s+"\" is found in category "+(a+1)+", element "+(b+1)+"\n");
          found=true;
        }
      }
    }
    if (!found)
      message.setText("\""+s+"\" was not found.");
  }
}