package main import . "fmt" import . "os" import bf "bufio" func main() { rd:=bf.NewReader(Stdin) 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 { Print(" ") } Print((v+c)%2) c-=e[i] } Println() }