{"trustable":true,"sections":[{"title":"","value":{"format":"MD","content":"Given a binary number, we are about to do some operations on the number. Two types of operations can be here:\n\n1. `I i j`, inverts all the bits from **i** to **j** (inclusive).\n2. `Q i` return whether the **i\u003csup\u003eth\u003c/sup\u003e** bit is 0 or 1.\n\nThe MSB (most significant bit) is the first bit **(i.e. i\u003d1)**. The binary number can contain leading zeroes.\n"}},{"title":"Input","value":{"format":"MD","content":"Input starts with an integer **T (\u0026#8804; 10)**, denoting the number of test cases.\n\t\nEach case starts with a line containing a binary integer having length **n** **(1 \u0026#8804; n \u0026#8804; 10\u003csup\u003e5\u003c/sup\u003e)**. The next line will contain an integer **q (1 \u0026#8804; q \u0026#8804; 50000)** denoting the number of queries.\n\nEach query will be either in the form `I i j` where **i, j** are integers and **1 \u0026#8804; i \u0026#8804; j \u0026#8804; n**. Or the query will be in the form `Q i` where **i** is an integer and **1 \u0026#8804; i \u0026#8804; n**.\n"}},{"title":"Output","value":{"format":"MD","content":"For each case, print the case number in a single line. Then for each query `Q i` you have to print 1 or 0 depending on the **i\u003csup\u003eth\u003c/sup\u003e** bit.\n"}},{"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\u003e2\n0011001100\n6\nI 1 10\nI 2 7\nQ 2\nQ 1\nQ 7\nQ 5\n1011110111\n6\nI 1 10\nI 2 7\nQ 2\nQ 1\nQ 7\nQ 5\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eCase 1:\n0\n1\n1\n0\nCase 2:\n0\n0\n0\n1\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Note","value":{"format":"MD","content":"Dataset is huge, use faster I/O methods."}}]}