#include #ifdef LOCAL #include "./debug.cpp" #else #define debug(...) #define print_line #endif using namespace std; using ll = long long; int main() { int N, M; cin >> N >> M; int tmp = 0; for (int i = 0; i < 1 << N; i++) { for (int j = 0; j < 1 << M; j++) { if (j > 0) { cout << ' '; } cout << tmp; tmp++; } cout << endl; } }