while True: try: commond = { "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", "he he": "unknown command", } kv = [] string = input().split() if len(string) == 1: if len(string[0]) == 1 and string[0] == "r": print("reset what") elif len(string[0]) > 1 and ( string[0] == "res" or string[0] == "rese" or string[0] == "reset" ): print("reset what") else: print("unknown command") elif len(string) == 2: for i in commond: k = i.split() p = i.find(" ") if ( string[0][: len(string[0])] in k[0][: len(string[0])] and p != -1 and string[1][: len(string[1])] in i[p + 1 : p + 1 + len(string[1])] ): kv.append(commond[i]) if len(kv) == 1: print(kv[0]) else: print("unknown command") except: break