n, m = [int(i) for i in input().split()]
spiral = [[0] * m for _ in range(n)]
c = 1
for k in range(min(n // 2 + 1, m //2 + 1)):
for j in range(k, m - k):
if spiral[k][j] == 0:
spiral[k][j] = c
c == 'x'
for i in range(1 + k, n - k):
if spiral[i][m - k - 1] == 0:
spiral[i][m - k - 1] = c
c == 'x'
for j in range(m - k - 2, k - 1, -1):
if spiral[n - k - 1][j] == 0:
spiral[n - k - 1][j] = c
c == 'x'
for i in range(n - k - 2, k, -1):
if spiral[i][k] == 0:
spiral[i][k] = c
c == 'x'
for i in range(n):
for j in range(m):
print(str(spiral[i][j]).ljust(3), end=' ')
print()
n, m= 19,19
spiral = [[0] * m for _ in range(n)]
c = 'x'
wt=m
hg=n
i=1
j=1
while wt-i>=2:
for k in range(i,wt-1):
spiral[j][k] = c
if hg-j>3:
for l in range(j,hg-1):
spiral[l][wt-2] = c
for k in range(i,wt-2):
spiral[hg-2][k] = c
for l in range(j+2,hg-1):
spiral[l][i] = c
spiral[j+2][i+1] = c
i+=2
j+=2
wt-=2
hg-=2
for i in range(n):
for j in range(m):
print(str(spiral[i][j]).ljust(3), end=' ')
print()
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 x x x x x x x x x x x x x x x x x 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 x 0
0 x x x x x x x x x x x x x x x 0 x 0
0 x 0 0 0 0 0 0 0 0 0 0 0 0 0 x 0 x 0
0 x 0 x x x x x x x x x x x 0 x 0 x 0
0 x 0 x 0 0 0 0 0 0 0 0 0 x 0 x 0 x 0
0 x 0 x 0 x x x x x x x 0 x 0 x 0 x 0
0 x 0 x 0 x 0 0 0 0 0 x 0 x 0 x 0 x 0
0 x 0 x 0 x 0 x x x 0 x 0 x 0 x 0 x 0
0 x 0 x 0 x 0 x 0 0 0 x 0 x 0 x 0 x 0
0 x 0 x 0 x 0 x x x x x 0 x 0 x 0 x 0
0 x 0 x 0 x 0 0 0 0 0 0 0 x 0 x 0 x 0
0 x 0 x 0 x x x x x x x x x 0 x 0 x 0
0 x 0 x 0 0 0 0 0 0 0 0 0 0 0 x 0 x 0
0 x 0 x x x x x x x x x x x x x 0 x 0
0 x 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 x 0
0 x x x x x x x x x x x x x x x x x 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0