#include <iomanip>
#include <math.h>
#include <iostream>
using namespace std;
int main()
{
	int red;
	static int kolona = 0;
	cin >> red;
	cin >> kolona;
	red++;
	int** matrica = new int*[red];
	int* protok = new int[kolona];
	for (int i = 0; i < kolona; i++)
	{
		protok[i] = 1;
	}
	for (int i = 0; i < red; i++)
	{
		matrica[i] = new int[kolona];
	}
	for (int i = 1; i < red; i++)
	{
		for (int j = 0; j < kolona; j++)
		{
			cin >> matrica[i][j];
		}
	}
	red--;
	for (int i = 0; i < red; i++)
	{
		for (int j = 0; j < kolona; j++)
		{
			if (matrica[i + 1][j] == 0)
	{
		if (j == 0)
		{
			protok[j + 1] += protok[j];
		}
		else if (j == kolona - 1)
		{
			protok[j - 1] += protok[j];
		}
		else
		{
			if (protok[j] % 2 == 0)
			{
				protok[j - 1] += protok[j] / 2;
				protok[j + 1] += protok[j] / 2;
			}
			else
			{
				if ((i + 1) % 2 == 0)
				{
					protok[j + 1] += 1 + (protok[j] - 1) / 2;
					protok[j - 1] += (protok[j] - 1) / 2;
				}
				else
				{
					protok[j + 1] += (protok[j] - 1) / 2;
					protok[j - 1] += 1 + (protok[j] - 1) / 2;
				}
			}
		}
		protok[j] = 0;
	}
		}
	}
	for (int i = 0; i < kolona; i++)
	{
		cout << protok[i];
		cout << " ";
	}
	red++;
	delete[] protok;
	for (int i = 0; i < red; i++)
	{
		delete[] matrica[i];
	}
	delete[] matrica;
	red--;

}