#include "testlib.h"
#include <iostream>
using namespace std;

int main() {
    registerValidation();
    int n = inf.readInt(1, 100000);
    inf.readSpace();
    int m = inf.readInt(1, 100000);
    ensure(n * m <= 100000);
    inf.readEoln();

    for(int i = 0; i < n; ++i) {
        std::string s = inf.readToken();
        ensure(s.length() == m);
        for(int t = 0; t < m; ++t) ensure(isdigit(s[t]) || s[t] == '*');
        inf.readEoln();
    }
    inf.readEof();
    return 0;
}
