#include <iostream>

using namespace std;

int main(int argc, char** argv)
{
    int w, h;
    string field[100];

    for (;;) {
        cin >> w >> h;
        cout << w << h;
        if ((w == 0) && (h == 0)) {
            break;
        }
        for (int i = 0; i < h; i++) {
            cin >> field[i];
        }

        cout << 0 << endl;
//      cout << count_div(w, h, field) << endl;
    }
    return 0;
}