The input consists of at most 50 datasets, each in the following format.
n m
b1,1...b1,m
...
bn,1...bn,m
The first line contains n, the number of recipes listed in the book, and m, the number of ingredients. Both n and m are positive integers with 1≤n≤500, 1≤m≤500 and 1≤n×m≤500. Each of the next n lines describes one recipe as a string of length m made of 0 and 1. If bi,j is 1, the i-th recipe needs the j-th ingredient, and if it is 0, it does not. Every such line contains at least one 1.
The end of the input is a line containing two zeros.