Concatenate  

Two or more arrays can be concatenated together using the concatenate function with a
tuple of the arrays to be joined:

import numpy

array_1 = numpy.array([1,2,3])
array_2 = numpy.array([4,5,6])
array_3 = numpy.array([7,8,9])

print numpy.concatenate((array_1, array_2, array_3))    

#Output
[1 2 3 4 5 6 7 8 9]

If an array has more than one dimension, it is possible to specify the axis along which multiple arrays are concatenated. By default, it is along the first dimension.

import numpy

array_1 = numpy.array([[1,2,3],[0,0,0]])
array_2 = numpy.array([[0,0,0],[7,8,9]])

print numpy.concatenate((array_1, array_2), axis = 1)   

#Output
[[1 2 3 0 0 0]
 [0 0 0 7 8 9]]    

Task  

You are given two integer arrays of size $N$X$\mbox{P}$ and $\mbox{M}$X$\mbox{P}$ ($N$ & $\mbox{M}$ are rows, and $\mbox{P}$ is the column).  Your task is to concatenate the arrays along axis $\mbox{o}$.

Input Format

The first line contains space separated integers $N$, $\mbox{M}$ and $\mbox{P}$. 

The next $N$ lines contains the space separated elements of the $\mbox{P}$ columns. 

After that, the next $\mbox{M}$ lines contains the space separated elements of the $\mbox{P}$ columns.

Output Format

Print the concatenated array of size $(N+M)$X$\mbox{P}$.

Sample Input
4 3 2
1 2
1 2 
1 2
1 2
3 4
3 4
3 4 

Sample Output
[[1 2]
 [1 2]
 [1 2]
 [1 2]
 [3 4]
 [3 4]
 [3 4]]

Source: hackerrank | Difficulty: EASY


Solutions:
import numpy
(N, M, P) = map(int, input().split())
arr_N = numpy.array([list(map(int, input().split())) for x in range(N)])
arr_M = numpy.array([list(map(int, input().split())) for x in range(M)])
print(numpy.concatenate((arr_N, arr_M), axis=0))


import numpy
(n, p, m) = [int(x) for x in input().split()]
a = []
for i in range(n + p):
	a.append([int(x) for x in input().split()])
print(numpy.array(a))


import numpy
(n, m, p) = list(map(int, input().split()))
a = numpy.array(list((input().split() for _ in range(n))), int)
b = numpy.array(list((input().split() for _ in range(m))), int)
c = numpy.concatenate((a, b))
print(c)


import numpy
(N, M, P) = input().strip().split()
N = int(N)
M = int(M)
P = int(P)
arrN = numpy.array([[int(x) for x in input().strip().split()] for _ in range(N)])
arrM = numpy.array([[int(x) for x in input().strip().split()] for _ in range(M)])
fullarr = numpy.concatenate((arrN, arrM), axis=0)
print(fullarr)


import numpy
(N, M, P) = map(int, input().strip().split())
arr1 = []
arr2 = []
for k in range(N):
	arr1.append(list(map(int, input().strip().split())))
for k in range(M):
	arr2.append(list(map(int, input().strip().split())))
arr1 = numpy.array(arr1, int)
arr2 = numpy.array(arr2, int)
print(numpy.concatenate((arr1, arr2), axis=0))


import numpy as np
(N, M, P) = map(int, input().split(' '))
arr1 = np.array([input().split() for i in range(N)], int)
arr2 = np.array([input().split() for i in range(M)], int)
print(np.concatenate((arr1, arr2), axis=0))


import numpy
(N, M, P) = map(int, input().split())
L1 = list()
L2 = list()
for _ in range(N):
	L1.extend(input().split())
for _ in range(M):
	L2.extend(input().split())
array_1 = numpy.array(L1, int)
array_2 = numpy.array(L2, int)
array_3 = numpy.concatenate((array_1, array_2))
array_3.shape = (N + M, P)
print(array_3)


import numpy
(n, m, p) = map(int, input().strip().split())
A = numpy.array([[int(j) for j in input().strip().split()] for i in range(n)])
B = numpy.array([[int(j) for j in input().strip().split()] for i in range(m)])
print(numpy.concatenate((A, B), axis=0))


import numpy
(n, m, p) = map(int, input().strip().split())
a = []
b = []
for _ in range(n):
	a.append(list(map(int, input().strip().split())))
for _ in range(m):
	b.append(list(map(int, input().strip().split())))
a = numpy.array(a)
b = numpy.array(b)
print(numpy.concatenate((a, b)))


import numpy as np
args = input()
nmp = list(map(int, args.split()))
n = nmp[0]
m = nmp[1]
p = nmp[2]
arr1 = []
arr2 = []
for i in range(0, n):
	vals = list(map(int, input().rstrip().split(' ')))
	arr1.append(vals)
for i in range(0, m):
	vals = list(map(int, input().rstrip().split(' ')))
	arr2.append(vals)
npa = np.array(arr1)
npb = np.array(arr2)
npc = np.concatenate((npa, npb), axis=0)
print(npc)


import numpy
(n, m, p) = map(int, input().split())
l = numpy.array([input().split() for _ in range(n)], int)
k = numpy.array([input().split() for _ in range(m)], int)
print(numpy.concatenate((l, k), axis=0))


import numpy
(N, M, P) = map(int, input().split())
array_1 = numpy.array([list(map(int, input().split())) for i in range(N)])
array_2 = numpy.array([list(map(int, input().split())) for i in range(M)])
print(numpy.concatenate((array_1, array_2), axis=0))


import numpy as np
(N, M, P) = map(int, input().split())
arr1 = np.array([list(map(int, input().split())) for _ in range(N)])
arr2 = np.array([list(map(int, input().split())) for _ in range(M)])
print(np.concatenate((arr1, arr2)))


import numpy
(n, m, p) = map(int, input().split())
a = numpy.array([list(map(int, input().split())) for i in range(n + m)])
print(a)


import numpy
[N, M, P] = [int(x) for x in input().split(' ')]
out = numpy.array([int(x.strip('\r')) for x in input().split(' ')])
for i in range(N + M - 1):
	newArray = numpy.array([int(x.strip('\r')) for x in input().split(' ') if x != '\r' and len(x) != 0])
	out = numpy.concatenate((out, newArray))
print(numpy.reshape(out, (N + M, P)))


import numpy
i = [i for i in map(int, input().split())]
(N, M, P) = (i[0], i[1], i[2])
a1 = numpy.array([[i for i in map(int, input().split())] for j in range(N)])
a2 = numpy.array([[i for i in map(int, input().split())] for j in range(M)])
print(numpy.concatenate((a1, a2)))


import numpy
(N, M, P) = map(int, input().split(' '))
arr1 = numpy.array([list(map(int, input().rstrip().split(' '))) for i in range(N)])
arr2 = numpy.array([list(map(int, input().rstrip().split(' '))) for i in range(M)])
print(numpy.concatenate((arr1, arr2)))


import numpy as np
[N, M, P] = list(map(int, input().split()))
(L1, L2) = ([], [])
for i in range(N):
	L1.append(list(map(int, input().split())))
for i in range(M):
	L2.append(list(map(int, input().split())))
npArr1 = np.array(L1)
npArr1.shape = (N, P)
npArr2 = np.array(L2)
npArr2.shape = (M, P)
print(np.concatenate((npArr1, npArr2)))


import numpy
(N, M, P) = map(int, input().split())
NP = numpy.array([input().split() for i in range(N)], int)
MP = numpy.array([input().split() for j in range(M)], int)
print(numpy.concatenate((NP, MP), axis=0))


import numpy
(n, m, p) = [int(num) for num in input().split()]
arr1 = []
for _ in range(n):
	arr1.append([int(num) for num in input().split()])
arr2 = []
for _ in range(m):
	arr2.append([int(num) for num in input().split()])
print(numpy.concatenate((numpy.array(arr1), numpy.array(arr2)), axis=0))


import numpy
(n, m, p) = map(int, input().split())
a = numpy.array([list(map(int, input().split())) for i in range(n)])
b = numpy.array([list(map(int, input().split())) for i in range(m)])
print(numpy.concatenate((a, b), 0))


import numpy
(N, M, P) = map(int, input().split())
(Nlist, Mlist) = ([], [])
for _ in range(N):
	Nlist.append(list(map(int, input().split())))
for _ in range(M):
	Mlist.append(list(map(int, input().split())))
print(numpy.concatenate((Nlist, Mlist), axis=0))


import numpy as np
(m, n, p) = map(int, input().split())
a = np.array([list(map(int, input().split())) for i in range(m)])
b = np.array([list(map(int, input().split())) for i in range(n)])
print(np.concatenate((a, b)))


import numpy
(N, M, P) = map(int, input().split())
a = numpy.array([list(map(int, input().split())) for _ in range(N)])
b = numpy.array([list(map(int, input().split())) for _ in range(M)])
print(numpy.concatenate((a, b)))


import numpy
(n, m, p) = map(int, input().split())
arra = numpy.array([list(map(int, input().split())) for _ in range(0, n)])
arrb = numpy.array([list(map(int, input().split())) for _ in range(0, m)])
print(numpy.concatenate((arra, arrb), axis=0))


import numpy as np
(n, m, p) = [int(i) for i in input().split()]
a = np.zeros((n, p), dtype='int32')
b = np.zeros((m, p), dtype='int32')
for i in range(n):
	a[i] = [int(i) for i in input().split()]
for i in range(m):
	b[i] = [int(i) for i in input().split()]
print(np.concatenate((a, b), axis=0))


import numpy as np
(N, M, P) = map(int, input().split())
NP = np.array([input().split() for i in range(N)], int)
MP = np.array([input().split() for i in range(M)], int)
print(np.concatenate((NP, MP), axis=0))


import numpy as np
l = list(map(int, input().split()))
array_1 = []
array_2 = []
for i in range(l[0]):
	array_1.append(list(map(int, input().split())))
for i in range(l[1]):
	array_2.append(list(map(int, input().split())))
np_array_1 = np.array(array_1)
np_array_2 = np.array(array_2)
print(np.concatenate((np_array_1, np_array_2), axis=0))


import numpy
d = []
e = []
(a, b, c) = input().split()
for i in range(int(a)):
	d.append(list(map(int, input().split())))
for _ in range(int(b)):
	e.append(list(map(int, input().split())))
f = numpy.array(d, int)
g = numpy.array(e, int)
print(numpy.concatenate((f, g), axis=0))


import numpy
(n, m, p) = map(int, input().split())
a1 = numpy.array([input().split() for _ in range(n)], int)
a2 = numpy.array([input().split() for _ in range(m)], int)
print(numpy.concatenate((a1, a2), axis=0))


import numpy
print(numpy.array([[int(x) for x in input().split()] for _ in range(sum([int(x) for x in input().split()[:2]]))]))


import sys
import numpy as np

def main():
	f = open(sys.argv[1], 'r') if len(sys.argv) > 1 else sys.stdin
	(N, M, P) = (int(i) for i in f.readline().split())
	A = np.array([[int(i) for i in f.readline().split()] for _ in range(N)])
	B = np.array([[int(i) for i in f.readline().split()] for _ in range(M)])
	print(np.concatenate((A, B)))
	if f != sys.stdin:
		f.close()
main()


import numpy
(N, M, P) = map(int, input().split(' '))
array1 = []
array2 = []
for i in range(N):
	row = input().split()
	array1.append(row)
for i in range(M):
	row = input().split()
	array2.append(row)
array1 = numpy.array(array1, int)
array2 = numpy.array(array2, int)
final = numpy.concatenate((array1, array2))
print(final)


import numpy
metrics = list(map(int, input().split()))
n = metrics[0]
m = metrics[1]
p = metrics[2]
a = []
b = []
for i in range(n):
	a.append(list(map(int, input().split())))
for i in range(m):
	b.append(list(map(int, input().split())))
a = numpy.array(a)
b = numpy.array(b)
print(numpy.concatenate((a, b), axis=0))


import numpy
(a, b, c) = map(int, input().split(' '))
arr1 = numpy.array([list(input().strip().split(' ')) for i in range(a)], int)
arr2 = numpy.array([list(input().strip().split(' ')) for i in range(b)], int)
print(numpy.concatenate((arr1, arr2)))


import numpy as np

def main():
	(n, m, p) = map(int, input().split())
	a = []
	for _ in range(n):
		a.append(np.array(input().split(), int))
	b = []
	for _ in range(m):
		b.append(np.array(input().split(), int))
	print(np.concatenate((a, b)))
main()


import numpy
(n, m, p) = [int(x) for x in input().split()]
NxP = []
MxP = []
for _ in range(n):
	NxP.append([int(x) for x in input().split()])
for _ in range(m):
	MxP.append([int(x) for x in input().split()])
(NxP, MxP) = (numpy.array(NxP), numpy.array(MxP))
print(numpy.concatenate((NxP, MxP)))


import numpy
(N, M, P) = input().split()
my_arr = []
for row in range(int(N) + int(M)):
	my_arr.append(input().split())
print(numpy.array(my_arr, int))


import numpy
(N, M, P) = list(map(int, input().split()))
first = []
second = []
for _ in range(N):
	first.append(input().split())
for _ in range(M):
	second.append(input().split())
first = numpy.array(first, int)
second = numpy.array(second, int)
third = numpy.concatenate((first, second), axis=0)
print(third)


import numpy
(N, M, P) = map(int, input().split())
A = numpy.array([input().split() for _ in range(N)], int)
B = numpy.array([input().split() for _ in range(M)], int)
print(numpy.concatenate((A, B)))


import numpy
(n, m, p) = map(int, input().split())
nl = []
ml = []
for _ in range(n):
	nl.append(list(map(int, input().split())))
for _ in range(m):
	ml.append(list(map(int, input().split())))
nl = numpy.array(nl)
ml = numpy.array(ml)
print(numpy.concatenate((nl, ml), axis=0))


import numpy as np
(n, m, p) = tuple(map(int, input().split()))
a = []
b = []
for _ in range(n):
	a.append(tuple(map(int, input().split())))
for _ in range(m):
	b.append(tuple(map(int, input().split())))
na = np.array(a)
nb = np.array(b)
print(np.concatenate((na, nb), axis=0))


from numpy import *
(N, M, P) = [int(x) for x in input().split()]
L1 = []
L2 = []
for i in range(N):
	L1.append([int(x) for x in input().split()])
for i in range(M):
	L2.append([int(x) for x in input().split()])
A1 = array(L1)
A2 = array(L2)
print(concatenate((A1, A2), axis=0))


import numpy
(a, b, c) = map(int, input().split())
arrayA = numpy.array([list(map(int, input().split())) for i in range(a)])
arrayB = numpy.array([list(map(int, input().split())) for j in range(b)])
print(numpy.concatenate((arrayA, arrayB), axis=0))


import numpy
x = list(map(int, input().split()))
l = []
l1 = []
for i in range(x[0]):
	a = list(map(int, input().split()))
	l.append(a)
for j in range(x[1]):
	b = list(map(int, input().split()))
	l1.append(b)
array_1 = numpy.array(l)
array_2 = numpy.array(l1)
print(numpy.concatenate((array_1, array_2), axis=0))


import numpy
(n, m, p) = list(map(int, input().split(' ')))
data1 = [numpy.array(input().strip().split(' '), int) for i in range(n)]
data2 = [numpy.array(input().strip().split(' '), int) for i in range(m)]
print(numpy.concatenate((data1, data2), axis=0))


import numpy
(n, m, p) = map(int, input().split())
a = numpy.array([input().split() for i in range(n)], int)
b = numpy.array([input().split() for i in range(m)], int)
print(numpy.concatenate((a, b), axis=0))


import numpy
(n, m, p) = [int(x) for x in input().strip().split()]
arr1 = []
arr2 = []
for _ in range(n):
	arr1.append([int(x) for x in input().strip().split()])
for _ in range(m):
	arr2.append([int(x) for x in input().strip().split()])
arr1 = numpy.array(arr1)
arr2 = numpy.array(arr2)
print(numpy.concatenate((arr1, arr2)))


import numpy
(n, m, p) = [int(x) for x in input().split()]
array_a = []
array_b = []
for _ in range(n):
	array_a.append([int(x) for x in input().split()])
for _ in range(m):
	array_b.append([int(x) for x in input().split()])
print(numpy.concatenate((array_a, array_b), axis=0))


import numpy
(N, M, P) = tuple(map(int, input().split()))
array1 = list()
array2 = list()
for _ in range(N):
	array1.append(list(map(int, input().split())))
for _ in range(M):
	array2.append(list(map(int, input().split())))
array3 = numpy.concatenate((array1, array2), axis=0)
print(array3)


import numpy
(n, m, p) = map(int, input().split())
a = numpy.array(list(map(int, input().split())))
for i in range(n + m - 1):
	a = numpy.concatenate((a, numpy.array(list(map(int, input().split())))), axis=0)
a.shape = (n + m, p)
print(a)


import numpy
(N, M, P) = map(int, input().split())
print(numpy.array([list(map(int, input().split())) for _ in range(N + M)]))


import numpy as np
(n, m, p) = map(int, input().split())
arr = []
for _ in range(m + n):
	arr.append([int(x) for x in input().split()])
mat = np.array(arr)
print(mat)


import numpy
(n, m, p) = map(int, input().split())
a = [list(map(int, input().split())) for _ in range(n)]
b = [list(map(int, input().split())) for _ in range(m)]
print(numpy.concatenate((a, b)))


import numpy as np
(n, m, p) = map(int, input().split())
x = np.fromstring(' '.join([input() for _ in range(n)]), sep=' ', dtype=int).reshape(n, p)
y = np.fromstring(' '.join([input() for _ in range(m)]), sep=' ', dtype=int).reshape(m, p)
print(np.concatenate((x, y)))


import numpy
(N, M, P) = [int(x) for x in input().split()]
ll = []
for i in range(N):
	ll += [int(x) for x in input().split()]
a = numpy.array(ll).reshape(N, P)
ll = []
for i in range(M):
	ll += [int(x) for x in input().split()]
b = numpy.array(ll).reshape(M, P)
print(numpy.concatenate((a, b)))


import numpy
(n, m, p) = (int(i) for i in input().split())
l = []
for _ in range(n):
	l.append(input().split())
(array_1, l) = (numpy.array(l, int), [])
for _ in range(m):
	l.append(input().split())
array_2 = numpy.array(l, int)
print(numpy.concatenate((array_1, array_2), axis=0))


import numpy
(n, m, p) = [int(a) for a in input().split(' ')]
arr1 = numpy.array([input().split() for a in range(n)], int)
arr2 = numpy.array([input().split() for a in range(m)], int)
print(numpy.concatenate((arr1, arr2), axis=0))


import numpy
(N, M, P) = [int(e) for e in input().split(' ')]
L1 = []

def traite(s):
	r = ''
	for e in s:
		if e != '\r':
			r += e
	return r
for a0 in range(N):
	L1.append([int(e) for e in traite(input()).split(' ') if e.isnumeric()])
L2 = []
for a0 in range(M):
	L2.append([int(e) for e in traite(input()).split(' ') if e.isnumeric()])
a1 = numpy.array(L1)
a2 = numpy.array(L2)
print(numpy.concatenate((L1, L2), axis=0))


import numpy as np
(n, m, p) = [int(x) for x in input().split()]
arr1 = []
arr2 = []
for _ in range(n):
	arr1.append([int(x) for x in input().split()])
for _ in range(m):
	arr2.append([int(x) for x in input().split()])
print(np.concatenate((np.array(arr1), np.array(arr2)), axis=0))


import numpy
(N, M, P) = map(int, input().split())
A = numpy.array([list(map(int, input().split())) for _ in range(N)])
B = numpy.array([list(map(int, input().split())) for _ in range(M)])
print(numpy.concatenate((A, B), axis=0))


import numpy
(n, m, p) = map(int, input().strip().split())
(a, b) = ([], [])
for i in range(n):
	a.append(list(map(int, input().strip().split())))
for i in range(m):
	b.append(list(map(int, input().strip().split())))
a = numpy.array(a)
b = numpy.array(b)
print(numpy.concatenate((a, b), axis=0))


import numpy as np

def parse_input(arg=None):
	raw = input() if arg is None else arg
	(n, m, p) = [int(i) for i in raw.split(' ')]
	data = [input() for e in range(n + m)]
	data = [[int(i.strip()) for i in e.split(' ') if i.strip()] for e in data]
	return (n, m, data)
(n, m, data) = parse_input()
x = np.array(data)
print(x)


import numpy
(N, M, P) = map(int, input().split())
arrays = numpy.array(list(map(int, input().split())))
for i in range(N + M - 1):
	a = numpy.array(list(map(int, input().split())))
	arrays = numpy.vstack((arrays, a))
print(arrays)


import numpy as np
import sys
(N, M, P) = list(map(int, sys.stdin.readline().split()))
A = np.array([sys.stdin.readline().split() for _ in range(N)], int)
B = np.array([sys.stdin.readline().split() for _ in range(M)], int)
print(np.concatenate((A, B), axis=0))


import numpy
(n, m, p) = map(int, input().split())
arr1 = []
arr2 = []
while n > 0:
	n = n - 1
	arr1.append([int(x) for x in input().split()])
while m > 0:
	m = m - 1
	arr2.append([int(x) for x in input().split()])
my_arr1 = numpy.array(arr1)
my_arr2 = numpy.array(arr2)
print(numpy.concatenate((my_arr1, my_arr2), axis=0))


import numpy as np
(N, M, P) = map(int, input().split())
A = np.array([list(map(int, input().split())) for _ in range(N)])
B = np.array([list(map(int, input().split())) for _ in range(M)])
print(np.concatenate((A, B)))


import numpy
matrix1 = []
matrix2 = []
(N, M, P) = list(map(int, input().strip().split()))
for i in range(N):
	matrix1.append(list(map(int, input().strip().split())))
for i in range(M):
	matrix2.append(list(map(int, input().strip().split())))
print(numpy.concatenate((matrix1, matrix2)))


import numpy
(n, m, p) = map(int, input().split())
arr1 = numpy.array([[int(x) for x in input().split()] for _ in range(n)])
arr2 = numpy.array([[int(x) for x in input().split()] for _ in range(m)])
print(numpy.concatenate((arr1, arr2), axis=0))


import numpy
(N, M, P) = map(int, input().split())
A = numpy.array([list(map(int, input().split())) for x in range(N)])
B = numpy.array([list(map(int, input().split())) for x in range(M)])
print(numpy.concatenate((A, B), axis=0))


import numpy as np
(n, m, p) = map(int, input().split())
arr1 = [list(map(int, input().split())) for _ in range(n)]
arr2 = [list(map(int, input().split())) for _ in range(m)]
print(np.concatenate((arr1, arr2), axis=0))


import numpy
(N, M, P) = map(int, input().split())
NP = numpy.array([list(map(int, input().split())) for i in range(N)])
MP = numpy.array([list(map(int, input().split())) for j in range(M)])
print(numpy.concatenate((NP, MP), axis=0))


import numpy
(n, m, p) = map(int, input().split())
a = numpy.array([[int(e) for e in input().split()] for i in range(n)])
b = numpy.array([[int(e) for e in input().split()] for i in range(m)])
print(numpy.concatenate((a, b), axis=0))


import numpy
(n, m, p) = map(int, input().split())
l1 = [list(map(int, input().split())) for i in range(n)]
l2 = [list(map(int, input().split())) for i in range(m)]
l1 = numpy.array(l1)
l2 = numpy.array(l2)
print(numpy.concatenate((l1, l2), axis=0))


import numpy
(M, N) = map(int, input().split()[:2])
(A, B) = [numpy.array([numpy.array(input().split(), int) for _ in range(R)]) for R in (M, N)]
print(numpy.concatenate((A, B)))


import numpy
(n, m, p) = map(int, input().split())
l = list()
for _ in range(n):
	l.append(list(map(int, input().split())))
a1 = numpy.array(l)
l.clear()
for _ in range(m):
	l.append(list(map(int, input().split())))
a2 = numpy.array(l)
print(numpy.concatenate((a1, a2), axis=0))


import numpy
(n, m, p) = input().split(' ')
a = [numpy.array(input().split(' ')[:2], int) for _ in range(int(n) + int(m))]
print(numpy.reshape(a, (int(n) + int(m), 2)))


from numpy import *

def get_array(n):
	return array(tuple((tuple((int(i) for i in input().split())) for _ in range(n))))
(n, m, p) = (int(i) for i in input().split())
(n_a, m_a) = (get_array(n), get_array(m))
print(concatenate((n_a, m_a), axis=0))


import numpy
(N, M, P) = tuple(map(int, input().split()))
arrN = numpy.array([list(map(int, input().split())) for i in range(N)])
arrM = numpy.array([list(map(int, input().split())) for i in range(M)])
print(numpy.concatenate((arrN, arrM)))


import numpy
(n, m, p) = map(int, input().split())
arr1 = numpy.array([input().split() for _ in range(n)], int)
arr2 = numpy.array([input().split() for _ in range(m)], int)
print(numpy.concatenate((arr1, arr2), axis=0))


import numpy
(N, M, P) = map(int, input().split())
Narr = numpy.array([list(map(int, input().split())) for _ in range(N)])
Marr = numpy.array([list(map(int, input().split())) for _ in range(M)])
print(numpy.concatenate((Narr, Marr), axis=0))


import operator
import numpy

def read_f(f):
	return f(input())

def read_f_words(f):
	return mapl(f, input().split())

def mapl(f, x):
	return list(map(f, list(x)))
(n, m, p) = read_f_words(int)
ns = []
for x in range(n + m):
	ns += read_f_words(int)
a = numpy.reshape(numpy.array(ns), (n + m, p))
print(a)


from numpy import array, concatenate
(N, M, P) = tuple(map(int, input().strip().split()))
array_1 = []
for _ in range(N):
	array_1.append(list(map(int, input().strip().split())))
array_1 = array(array_1)
array_2 = []
for _ in range(M):
	array_2.append(list(map(int, input().strip().split())))
array_2 = array(array_2)
print(concatenate((array_1, array_2), axis=0))


import numpy
(n, m, p) = map(int, input().split())
input_arrays = numpy.array([list(map(int, input().split())) for _ in range(n + m)])
print(input_arrays)


import numpy as np
inp = input()
(N, M, P) = map(int, inp.split())
matrix1 = np.empty((N, P), dtype=int)
matrix2 = np.empty((M, P), dtype=int)
for i in range(N):
	inp = input()
	matrix1[i] = np.array(list(map(int, inp.split())))
for i in range(M):
	inp = input()
	matrix2[i] = np.array(list(map(int, inp.split())))
print(np.concatenate([matrix1, matrix2]))


import numpy
(n, m, p) = map(int, input().split())
lista1 = [list(map(int, input().split())) for i in range(n)]
lista2 = [list(map(int, input().split())) for i in range(m)]
a1 = numpy.array(lista1)
a2 = numpy.array(lista2)
print(numpy.concatenate((a1, a2), axis=0))


import numpy
(n, m, p) = map(int, input().split())
a1 = numpy.array([input().split() for i in range(n)], int)
a2 = numpy.array([input().split() for i in range(m)], int)
print(numpy.concatenate((a1, a2), axis=0))


import numpy as np
(n, m, p) = [int(i) for i in input().split()]
a = []
for _ in range(n):
	a.append([int(i) for i in input().split()])
A = np.array(a)
b = []
for _ in range(m):
	b.append([int(i) for i in input().split()])
B = np.array(b)
print(np.concatenate((A, B)))


import numpy
(n, m, p) = list(map(int, input().split()))
ar1 = []
ar2 = []
for i in range(n):
	tmp = list(map(int, input().split()))
	ar1.append(tmp)
for i in range(m):
	tmp = list(map(int, input().split()))
	ar2.append(tmp)
np_ar1 = numpy.array(ar1)
np_ar2 = numpy.array(ar2)
print(numpy.concatenate((np_ar1, np_ar2), axis=0))


import numpy
arr1 = []
arr2 = []
(m, n, p) = list(map(int, input().split()))
for i in range(m):
	arr1.append(list(map(int, input().split())))
for i in range(n):
	arr2.append(list(map(int, input().split())))
arr1 = numpy.array(arr1)
arr1 = numpy.reshape(arr1, (m, p))
arr2 = numpy.array(arr2)
arr2 = numpy.reshape(arr2, (n, p))
print(numpy.concatenate((arr1, arr2), axis=0))


import numpy
(N, M, P) = map(int, input().split())
NP = numpy.array([list(map(int, input().split())) for i in range(N)])
MP = numpy.array([list(map(int, input().split())) for j in range(M)])
print(numpy.concatenate((NP, MP)))


import numpy as np
(m, n, p) = map(int, input().split())
listn = []
listm = []
for i in range(n + m):
	if i < n:
		listn.append(list(map(int, input().split())))
	else:
		listm.append(list(map(int, input().split())))
ar_n = np.array(listn)
ar_n.shape = (n, p)
ar_m = np.array(listm)
ar_m.shape = (m, p)
ar_mn = np.concatenate((ar_n, ar_m), axis=0)
ar_mn.shape = (m + n, p)
print(ar_mn)


import numpy
(n, m, p) = map(int, input().split())
a = []
for i in range(n):
	a.append(list(map(int, input().split())))
a = numpy.array(a)
b = []
for i in range(m):
	b.append(list(map(int, input().split())))
b = numpy.array(b)
print(numpy.concatenate((a, b), axis=0))