package main import . "fmt" import . "os" import bf "bufio" func main() { rd:=bf.NewReader(Stdin) wr:=bf.NewWriter(Stdout) var n,q int Fscan(rd,&n,&q) a:=make([]int,n) for i:=range a { Fscan(rd,&a[i]) } s:=make([]int,n) e:=make([]int,n) for ;q>0;q-- { var l,r int Fscan(rd,&l,&r) s[l-1]++ e[r-1]++ } c:=0 for i,v:=range a { c+=s[i] if i>0 { Fprint(wr," ") } Fprint(wr,(v+c)%2) c-=e[i] } Fprintln(wr) wr.Flush() }