{"raw_statement":[{"iden":"statement","content":"There are _n_ lamps in a line. The lamps are numbered 1 to _n_ from left to right. There are also _n_ keys. When key number _i_ is pressed, all lamps number _x_ such that _i_|_x_ change their state.\n\nFor two integer numbers _a_ and _b_, we say _a_|_b_ if and only if there exists an integer _c_ such that _a_ × _c_ = _b_.\n\nAmirali likes to play with the keys. He randomly pressed _k_ keys and wants to know the final state of the lamps. Help him by writing a Pike piece of code to solve this task."},{"iden":"input","content":"The first line of input contains a single integer _n_, the number of lamps (1 ≤ _n_ ≤ 105).\n\nThe following line contains _n_ words. The _i_\\-th word describes the initial state of lamp number _i_ (see samples for details).\n\nThe following line contains a single integer _k_ (1 ≤ _k_ ≤ 104), the number of times a key is pressed. Then in the next line come _k_ integers in range \\[1, _n_\\] which are the numbers of the pressed keys."},{"iden":"output","content":"Write _n_ words to output. Describe the final state of the lamps. See samples for more details."},{"iden":"examples","content":"Input\n\n2\noff off\n2\n1 2\n\nOutput\n\non off \n\nInput\n\n3\noff off on\n6\n1 1 1 1 2 2\n\nOutput\n\noff off on"}],"translated_statement":[{"iden":"statement","content":"有一排 #cf_span[n] 盏灯，从左到右编号为 #cf_span[1] 到 #cf_span[n]。同时有 #cf_span[n] 个按键。当按下第 #cf_span[i] 个按键时，所有满足 #cf_span[i|x] 的灯 #cf_span[x] 都会改变状态。\n\n对于两个整数 #cf_span[a] 和 #cf_span[b]，我们说 #cf_span[a|b] 当且仅当存在整数 #cf_span[c] 使得 #cf_span[a × c = b]。\n\nAmirali 喜欢玩这些按键。他随机按下了 #cf_span[k] 个按键，想知道灯的最终状态。请帮他写一段 #cf_span(class=[tex-font-style-underline], body=[Pike]) 代码来解决这个问题。\n\n输入的第一行包含一个整数 #cf_span[n]，表示灯的数量（#cf_span[1 ≤ n ≤ 105]）。\n\n第二行包含 #cf_span[n] 个单词，第 #cf_span[i] 个单词描述第 #cf_span[i] 盏灯的初始状态（详见样例）。\n\n第三行包含一个整数 #cf_span[k]（#cf_span[1 ≤ k ≤ 104]），表示按键被按下的次数。接下来一行包含 #cf_span[k] 个在范围 #cf_span[[1, n]] 内的整数，表示被按下的按键编号。\n\n请输出 #cf_span[n] 个单词，描述灯的最终状态。详见样例。"},{"iden":"input","content":"输入的第一行包含一个整数 #cf_span[n]，表示灯的数量（#cf_span[1 ≤ n ≤ 105]）。第二行包含 #cf_span[n] 个单词，第 #cf_span[i] 个单词描述第 #cf_span[i] 盏灯的初始状态（详见样例）。第三行包含一个整数 #cf_span[k]（#cf_span[1 ≤ k ≤ 104]），表示按键被按下的次数。接下来一行包含 #cf_span[k] 个在范围 #cf_span[[1, n]] 内的整数，表示被按下的按键编号。"},{"iden":"output","content":"请输出 #cf_span[n] 个单词，描述灯的最终状态。详见样例。"},{"iden":"examples","content":"输入\n2\noff off\n2\n1 2\n输出\non off \n\n输入\n3\noff off on\n6\n1 1 1 1 2 2\n输出\noff off on "}],"sample_group":[],"show_order":[],"formal_statement":"**Definitions**  \nLet $ n \\in \\mathbb{Z}^+ $ be the number of lamps and keys.  \nLet $ s = (s_1, s_2, \\dots, s_n) \\in \\{0,1\\}^n $ be the initial state of the lamps, where $ s_i \\in \\{0,1\\} $ represents the initial state of lamp $ i $.  \nLet $ K = (k_1, k_2, \\dots, k_k) \\in \\{1, 2, \\dots, n\\}^k $ be the sequence of pressed keys, with $ k \\in \\mathbb{Z}^+ $ being the number of presses.  \n\n**Constraints**  \n1. $ 1 \\leq n \\leq 10^5 $  \n2. $ 1 \\leq k \\leq 10^4 $  \n3. For all $ i \\in \\{1, \\dots, n\\} $, $ s_i \\in \\{0,1\\} $  \n4. For all $ j \\in \\{1, \\dots, k\\} $, $ 1 \\leq k_j \\leq n $  \n\n**Objective**  \nFor each lamp $ i \\in \\{1, \\dots, n\\} $, let $ f(i) $ denote the number of keys $ k_j \\in K $ such that $ k_j \\mid i $.  \nThe final state of lamp $ i $ is:  \n$$\ns_i' = s_i \\oplus (f(i) \\bmod 2)\n$$  \nOutput $ (s_1', s_2', \\dots, s_n') $.","simple_statement":null,"has_page_source":false}