{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003eWFF \u0027N PROOF is a logic game played with dice. Each die has six faces representing some subset of the possible symbols K, A, N, C, E, p, q, r, s, t. A Well-formed formula (WFF) is any string of these symbols obeying the following rules: \u003c/p\u003e\u003cul\u003e\u003cli\u003ep, q, r, s, and t are WFFs \u003c/li\u003e\u003cli\u003eif \u003ci\u003ew\u003c/i\u003e is a WFF, N\u003ci\u003ew\u003c/i\u003e is a WFF \u003c/li\u003e\u003cli\u003eif \u003ci\u003ew\u003c/i\u003e and \u003ci\u003ex\u003c/i\u003e are WFFs, K\u003ci\u003ewx\u003c/i\u003e, A\u003ci\u003ewx\u003c/i\u003e, C\u003ci\u003ewx\u003c/i\u003e, and E\u003ci\u003ewx\u003c/i\u003e are WFFs. \u003c/li\u003e\u003c/ul\u003eThe meaning of a WFF is defined as follows: \u003cul\u003e\u003cli\u003ep, q, r, s, and t are logical variables that may take on the value 0 (false) or 1 (true). \u003c/li\u003e\u003cli\u003eK, A, N, C, E mean \u003ci\u003eand, or, not, implies,\u003c/i\u003e and \u003ci\u003eequals\u003c/i\u003e as defined in the truth table below. \u003c/li\u003e\u003c/ul\u003e\u003ccenter\u003e\u003ctable cols\u003d\"1\" width\u003d\"80%\" bgcolor\u003d\"#ccffff\" border\u003d\"1\" id\u003d\"table1\"\u003e\u003ctbody\u003e\u003ctr\u003e\u003ctd\u003e\u003ccenter\u003e\u003cb\u003e\u003cfont size\u003d\"+1\" color\u003d\"#000099\"\u003eDefinitions of K, A, N, C, and E\u003c/font\u003e\u003c/b\u003e\u003c/center\u003e\u003c/td\u003e\u003c/tr\u003e\u003c/tbody\u003e\u003c/table\u003e\u003ctable cols\u003d\"6\" width\u003d\"80%\" bgcolor\u003d\"#ccffff\" border\u003d\"1\" id\u003d\"table2\"\u003e\u003ctbody\u003e\u003ctr\u003e\u003ctd\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; \u003cb\u003e\u003cfont size\u003d\"+1\" face\u003d\"Courier New,Courier\"\u003e\u003ci\u003ew\u003c/i\u003e\u0026nbsp; \u003ci\u003ex\u003c/i\u003e\u003c/font\u003e\u003c/b\u003e\u003c/td\u003e\u003ctd\u003e\u003cb\u003e\u003cfont size\u003d\"+1\" face\u003d\"Courier New,Courier\"\u003e\u0026nbsp; K\u003ci\u003ewx\u003c/i\u003e\u003c/font\u003e\u003c/b\u003e\u003c/td\u003e\u003ctd\u003e\u003cb\u003e\u003cfont size\u003d\"+1\" face\u003d\"Courier New,Courier\"\u003e\u0026nbsp; A\u003ci\u003ewx\u003c/i\u003e\u003c/font\u003e\u003c/b\u003e\u003c/td\u003e\u003ctd\u003e\u003cb\u003e\u003cfont size\u003d\"+1\" face\u003d\"Courier New,Courier\"\u003e\u0026nbsp;\u0026nbsp; N\u003ci\u003ew\u003c/i\u003e\u003c/font\u003e\u003c/b\u003e\u003c/td\u003e\u003ctd\u003e\u003cb\u003e\u003cfont size\u003d\"+1\" face\u003d\"Courier New,Courier\"\u003e\u0026nbsp; C\u003ci\u003ewx\u003c/i\u003e\u003c/font\u003e\u003c/b\u003e\u003c/td\u003e\u003ctd\u003e\u003cb\u003e\u003cfont size\u003d\"+1\" face\u003d\"Courier New,Courier\"\u003e\u0026nbsp; E\u003ci\u003ewx\u003c/i\u003e\u003c/font\u003e\u003c/b\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003e\u003cb\u003e\u003cfont size\u003d\"+1\" face\u003d\"Courier New,Courier\"\u003e\u0026nbsp; 1\u0026nbsp; 1\u003c/font\u003e\u003c/b\u003e\u003c/td\u003e\u003ctd\u003e\u003cb\u003e\u003cfont size\u003d\"+1\" face\u003d\"Courier New,Courier\"\u003e\u0026nbsp; 1\u003c/font\u003e\u003c/b\u003e\u003c/td\u003e\u003ctd\u003e\u003cb\u003e\u003cfont size\u003d\"+1\" face\u003d\"Courier New,Courier\"\u003e\u0026nbsp; 1\u003c/font\u003e\u003c/b\u003e\u003c/td\u003e\u003ctd\u003e\u003cb\u003e\u003cfont size\u003d\"+1\" face\u003d\"Courier New,Courier\"\u003e\u0026nbsp;\u0026nbsp; 0\u003c/font\u003e\u003c/b\u003e\u003c/td\u003e\u003ctd\u003e\u003cb\u003e\u003cfont size\u003d\"+1\" face\u003d\"Courier New,Courier\"\u003e\u0026nbsp; 1\u003c/font\u003e\u003c/b\u003e\u003c/td\u003e\u003ctd\u003e\u003cb\u003e\u003cfont size\u003d\"+1\" face\u003d\"Courier New,Courier\"\u003e\u0026nbsp; 1\u003c/font\u003e\u003c/b\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003e\u003cb\u003e\u003cfont size\u003d\"+1\" face\u003d\"Courier New,Courier\"\u003e\u0026nbsp; 1\u0026nbsp; 0\u003c/font\u003e\u003c/b\u003e\u003c/td\u003e\u003ctd\u003e\u003cb\u003e\u003cfont size\u003d\"+1\" face\u003d\"Courier New,Courier\"\u003e\u0026nbsp; 0\u003c/font\u003e\u003c/b\u003e\u003c/td\u003e\u003ctd\u003e\u003cb\u003e\u003cfont size\u003d\"+1\" face\u003d\"Courier New,Courier\"\u003e\u0026nbsp; 1\u003c/font\u003e\u003c/b\u003e\u003c/td\u003e\u003ctd\u003e\u003cb\u003e\u003cfont size\u003d\"+1\" face\u003d\"Courier New,Courier\"\u003e\u0026nbsp;\u0026nbsp; 0\u003c/font\u003e\u003c/b\u003e\u003c/td\u003e\u003ctd\u003e\u003cb\u003e\u003cfont size\u003d\"+1\" face\u003d\"Courier New,Courier\"\u003e\u0026nbsp; 0\u003c/font\u003e\u003c/b\u003e\u003c/td\u003e\u003ctd\u003e\u003cb\u003e\u003cfont size\u003d\"+1\" face\u003d\"Courier New,Courier\"\u003e\u0026nbsp; 0\u003c/font\u003e\u003c/b\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003e\u003cb\u003e\u003cfont size\u003d\"+1\" face\u003d\"Courier New,Courier\"\u003e\u0026nbsp; 0\u0026nbsp; 1\u003c/font\u003e\u003c/b\u003e\u003c/td\u003e\u003ctd\u003e\u003cb\u003e\u003cfont size\u003d\"+1\" face\u003d\"Courier New,Courier\"\u003e\u0026nbsp; 0\u003c/font\u003e\u003c/b\u003e\u003c/td\u003e\u003ctd\u003e\u003cb\u003e\u003cfont size\u003d\"+1\" face\u003d\"Courier New,Courier\"\u003e\u0026nbsp; 1\u003c/font\u003e\u003c/b\u003e\u003c/td\u003e\u003ctd\u003e\u003cb\u003e\u003cfont size\u003d\"+1\" face\u003d\"Courier New,Courier\"\u003e\u0026nbsp;\u0026nbsp; 1\u003c/font\u003e\u003c/b\u003e\u003c/td\u003e\u003ctd\u003e\u003cb\u003e\u003cfont size\u003d\"+1\" face\u003d\"Courier New,Courier\"\u003e\u0026nbsp; 1\u003c/font\u003e\u003c/b\u003e\u003c/td\u003e\u003ctd\u003e\u003cb\u003e\u003cfont size\u003d\"+1\" face\u003d\"Courier New,Courier\"\u003e\u0026nbsp; 0\u003c/font\u003e\u003c/b\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003e\u003cb\u003e\u003cfont size\u003d\"+1\" face\u003d\"Courier New,Courier\"\u003e\u0026nbsp; 0\u0026nbsp; 0\u003c/font\u003e\u003c/b\u003e\u003c/td\u003e\u003ctd\u003e\u003cb\u003e\u003cfont size\u003d\"+1\" face\u003d\"Courier New,Courier\"\u003e\u0026nbsp; 0\u003c/font\u003e\u003c/b\u003e\u003c/td\u003e\u003ctd\u003e\u003cb\u003e\u003cfont size\u003d\"+1\" face\u003d\"Courier New,Courier\"\u003e\u0026nbsp; 0\u003c/font\u003e\u003c/b\u003e\u003c/td\u003e\u003ctd\u003e\u003cb\u003e\u003cfont size\u003d\"+1\" face\u003d\"Courier New,Courier\"\u003e\u0026nbsp;\u0026nbsp; 1\u003c/font\u003e\u003c/b\u003e\u003c/td\u003e\u003ctd\u003e\u003cb\u003e\u003cfont size\u003d\"+1\" face\u003d\"Courier New,Courier\"\u003e\u0026nbsp; 1\u003c/font\u003e\u003c/b\u003e\u003c/td\u003e\u003ctd\u003e\u003cb\u003e\u003cfont size\u003d\"+1\" face\u003d\"Courier New,Courier\"\u003e\u0026nbsp; 1\u003c/font\u003e\u003c/b\u003e\u003c/td\u003e\u003c/tr\u003e\u003c/tbody\u003e\u003c/table\u003e\u003c/center\u003e\u003cp\u003e\u003c/p\u003e\u003cp\u003eA \u003ci\u003etautology\u003c/i\u003e is a WFF that has value 1 (true) regardless of the values of its variables. For example, \u003ci\u003eApNp\u003c/i\u003e is a tautology because it is true regardless of the value of \u003ci\u003ep\u003c/i\u003e. On the other hand, \u003ci\u003eApNq\u003c/i\u003e is not, because it has the value 0 for \u003ci\u003ep\u003d0, q\u003d1\u003c/i\u003e. \u003c/p\u003e\u003cp\u003eYou must determine whether or not a WFF is a tautology. \u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003eInput consists of several test cases. Each test case is a single line containing a WFF with no more than 100 symbols. A line containing 0 follows the last case. \u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003eFor each test case, output a line containing \u003ci\u003etautology\u003c/i\u003e or \u003ci\u003enot\u003c/i\u003e as appropriate. \u003c/p\u003e"}},{"title":"Sample","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003eApNp\r\nApNq\r\n0\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003etautology\r\nnot\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}