#include <bits/stdc++.h>
using namespace std;
bool is(long long x) {
  long long t = sqrt(x) + 0.1;
  return t * t == x;
}
int main() {
  int n, m;
  cin >> n >> m;
  if (n == 1 && m == 1) {
    puts("1");
    return 0;
  }
  if (n == 1 || m == 1) {
    int s = n * m, a, b;
    for (a = 1;; ++a)
      for (b = 1; b <= a; ++b)
        if (is(a * a + b * b + s - 2)) {
          for (int i = 0, k = 0; i < n; ++i)
            for (int j = 0; j < m; ++j, ++k) {
              int x = 1;
              if (k == 0) x = a;
              if (k == 1) x = b;
              printf("%d%c", x, j + 1 < m ? ' ' : '\n');
            }
          return 0;
        }
  }
  for (int a = 1;; ++a) {
    vector<int> bs, cs;
    long long a2 = (long long)a * a;
    for (int b = 1; b <= a * 3; ++b)
      if (is(a2 * (n - 1) + (long long)b * b)) bs.push_back(b);
    for (int c = 1; c <= a * 3; ++c)
      if (is(a2 * (m - 1) + (long long)c * c)) cs.push_back(c);
    for (int b : bs)
      for (int d = 1; d <= b * 2; ++d)
        if (is(b * (long long)b * (m - 1) + d * (long long)d))
          for (int c : cs)
            if ((is(c * (long long)c * (n - 1) + d * (long long)d))) {
              for (int i = 0; i < n; ++i)
                for (int j = 0; j < m; ++j)
                  printf(
                      "%d%c",
                      (i + 1 < n ? (j + 1 < m ? a : c) : (j + 1 < m ? b : d)),
                      j + 1 < m ? ' ' : '\n');
              return 0;
            }
  }
}
