package java0305.配置文件恢复;
//reset reset what
//reset board board fault
//board add where to add
//board delete no board at all
//reboot backplane impossible
//backplane abort install first
//unkown command
//r
//reb
//r b
//a b
//bo a
//boa del
//rebo bac
//baclane ab
import java.util.*;
public class Main
{
public static void main(String[] args) {
Scanner input= new Scanner(System.in);
ArrayList<String> arrayList = new ArrayList<String>();
do {
String string =input.nextLine();
if (string.isEmpty()) {
break;
}
// System.out.println("add "+string);
arrayList.add(string);
} while (true);
for(int i=0;i<arrayList.size();i++)
{
String[] string=arrayList.get(i).split(" ");
if(string.length>2)
{
System.out.println("unkown command");
}else if(string.length==1)
{
if("reset".indexOf(string[0])==0)
{
System.out.println("reset what");
}else
{
// System.out.println("关键字少了");
System.out.println("unkown command");
}
}else if(string.length==2)
{
if(matchNum(string)!=1)
{
// System.out.println("匹配不成功或者多了");
System.out.println("unkown command");
}else
{
System.out.println(match(string));
}
}
}
}
static int matchNum(String [] string)
{
int a=0;
if("reset".indexOf(string[0])==0)
{
if("board".indexOf(string[1])==0)
{
a++;
}
}
if("board".indexOf(string[0])==0)
{
if("add".indexOf(string[1])==0)
{
a++;
}else if("delete".indexOf(string[1])==0)
{
a++;
}
}
if("reboot".indexOf(string[0])==0)
{
if("backplane".indexOf(string[1])==0)
{
a++;
}
}
if("backplane".indexOf(string[0])==0)
{
if("abort".indexOf(string[1])==0)
{
a++;
}
}
return a;
}
static String match(String [] string)
{
if("reset".indexOf(string[0])==0)
{
if("board".indexOf(string[1])==0)
{
return "board fault";
}
}
if("board".indexOf(string[0])==0)
{
if("add".indexOf(string[1])==0)
{
return "where to add";
}else if("delete".indexOf(string[1])==0)
{
return "no board at all";
}
}
if("reboot".indexOf(string[0])==0)
{
if("backplane".indexOf(string[1])==0)
{
return "impossible";
}
}
if("backplane".indexOf(string[0])==0)
{
if("abort".indexOf(string[1])==0)
{
return "install first";
}
}
return "unkown command";
}
}