This is an interactive problem.
Pavel is a famous prosecutor. Throughout his career, he had convicted a lot of scammers, money-launderers and other criminals who plagued the city of Baǵel. Recently a major scam scheme was uncovered. The scammers had a connected undirected graph G=⟨V,E⟩ with maximum vertex degree at most 10, and a function f:V→0,1. They have suggested people to try find a function g:E→0,1 such that, for every v∈V, the equality ⨁_e∈I(v)g(e)=f(v) holds. Here, I(v) is the set of edges of G incident to v, and ⊕ is sum modulo 2.
Pavel has quickly noticed that ⨁_v∈Vf(v)=1 and concluded that such g does not exist! But how to convince the jury that it is so?
Sam, the leader of this scam group, claims that such g exists and that he knows exactly what it is. Pavel is going to ask him questions about this claimed g until he finds a simple contradiction in Sam's answers.
Pavel can only ask questions in the form of boolean formulas with variables corresponding to the values of g. Let us enumerate the edges and identify them with their numbers. Let us define a boolean formula:
Sam answers 0 (false) or 1 (true) to each question. The types of simple contradictions that the jury recognizes are the following:
Formally, Sam's claim that g satisfies the parity condition for every v∈V which means that, for every v∈V, the equality ⨁_e∈I(v)g(e)=f(v) holds, is interpreted as follows. For each vertex v∈V and each subset S⊆I(v) such that its size ∣S∣mod2=f(v), it is assumed that Sam has answered 1 to the formula ⋁_i∈S!(gi)∨⋁_i∈I(v)∖Sgi. We refer to these formulas as axioms. Pavel can ask them, and Sam will answer 1.
Here we assume that the whole big disjunction is written in right-associative form. For example, the formula x∨y∨z is written as (x)|((y)|(z)). The variables in the axioms are ordered so that their numbers are increasing from left to right. So, for example, an axiom ⋁_i∈1,3!(gi)∨⋁_i∈2gi is written as (!(g1))|((g2)|(!(g3))).
Pavel would like to convince the jury as soon as possible, so he would like to ask at most 50 questions.
Additionally, Pavel would like to ask formulas that are not too deep, so the jury wouldn't become confused. The depth d(F) of a formula F is defined recursively:
Every formula that Pavel asks must have depth at most 100.
The first line contains two integers n and m (1≤n≤100, 1≤m≤150): the number of vertices and the number of edges in G respectively. The vertices are numbered from 1 to n, and the edges are numbered from 1 to m.
The second line contains n integers f(1),f(2),…,f(n)∈0,1. It is guaranteed that their sum is odd.
The next m lines contain the description of the edges of G. Each of these lines contains two distinct integers from the set 1,…,n: the ends of the corresponding edge.
It is guaranteed that the given graph is connected and has maximum vertex degree at most 10. Note that the graph may contain parallel edges.
In the example, the boolean formula "(!(g1))|(!(g2))" is an axiom.