#include <bits/stdc++.h>
using namespace std;
const int INF = 1000000000;
inline int add(int a, int b, int mod = 1000000007) {
  return a + b < mod ? a + b : a + b - mod;
}
inline void addBy(int &a, int b, int mod = 1000000007) { a = add(a, b, mod); }
inline int sub(int a, int b, int mod = 1000000007) {
  return a - b < 0 ? a - b + mod : a - b;
}
inline void subBy(int &a, int b, int mod = 1000000007) { a = sub(a, b, mod); }
inline int mul(int a, int b, int mod = 1000000007) {
  return (long long)a * b % mod;
}
inline void mulBy(int &a, int b, int mod = 1000000007) { a = mul(a, b, mod); }
int inverse(int a, int mod = 1000000007) {
  int d = mod, x = 0, s = 1, q, r, t;
  while (a != 0) {
    q = d / a, r = d % a;
    d = a, a = r;
    t = x - q * s, x = s, s = t;
  }
  if (d != 1) return -1;
  return (x + mod) % mod;
}
inline int divide(int a, int b, int mod = 1000000007) {
  return mul(a, inverse(b, mod), mod);
}
long long mul(long long a, long long b, long long mod = 1000000007) {
  long long x = 0, y = a % mod;
  while (b > 0) {
    if (b % 2 == 1) {
      x = x + y;
      if (x >= mod) x -= mod;
    }
    y = y * 2;
    if (y >= mod) y -= mod;
    b /= 2;
  }
  return x % mod;
}
template <class T>
T pow(T a, T b, T c = 1000000007) {
  T x = 1, y = a;
  while (b > 0) {
    if (b % 2 == 1) {
      x = mul(x, y, c);
    }
    y = mul(y, y, c);
    b /= 2;
  }
  return x % c;
}
vector<int> factorial(1, 1);
int fact(int n) {
  while (factorial.size() <= n)
    factorial.push_back(mul(factorial.back(), factorial.size()));
  return factorial[n];
}
int choose(int n, int k) {
  if (n < k) return 0;
  return divide(fact(n), mul(fact(k), fact(n - k)));
}
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  vector<vector<int> > ans(n, vector<int>(m));
  vector<int> r(n, 1), c(m, 1);
  if (n % 2 && n >= 2) r[n - 2] = 2;
  if (m % 2 && m >= 2) c[m - 2] = 2;
  r[n - 1] = (n % 2) ? n / 2 + 1 : n / 2 - 1;
  c[m - 1] = (m % 2) ? m / 2 + 1 : m / 2 - 1;
  if (n == 2) r[0] = 3, r[1] = 4;
  if (m == 2) c[0] = 3, c[1] = 4;
  if (n == 1) r[0] = 1;
  if (m == 1) c[0] = 1;
  for (int i = 0; i < (n); i++)
    for (int j = 0; j < (m); j++) {
      if (j == m - 1)
        printf("%d\n", r[i] * c[j]);
      else
        printf("%d ", r[i] * c[j]);
    }
  return 0;
}
