gets a=[*?0..?9] $_[-2]==?O?a-=$_.split: a&=$_.split while gets p a[0]