AtCoder Beginner Contest 090 - Diagonal String

We have a 3×3 square grid, where each square contains a lowercase English letters.
The letter in the square at the i-th row from the top and j-th column from the left is c_{ij}.
Print the string of length 3 that can be obtained by concatenating the letters in the squares on the diagonal connecting the top-left and bottom-right corner of the grid, from the top-left to bottom-right.

-----Constraints-----
 - Input consists of lowercase English letters.

-----Input-----
Input is given from Standard Input in the following format:
c_{11}c_{12}c_{13}
c_{21}c_{22}c_{23}
c_{31}c_{32}c_{33}

-----Output-----
Print the string of length 3 that can be obtained by concatenating the letters on the diagonal connecting the top-left and bottom-right corner of the grid, from the top-left to bottom-right.

-----Sample Input-----
ant
obe
rec

-----Sample Output-----
abc

The letters in the squares on the diagonal connecting the top-left and bottom-right corner of the grid are a, b and c from top-right to bottom-left. Concatenate these letters and print abc.

Source: atcoder | Difficulty: EASY


Solutions:
s = ''
for i in range(3):
	s += input()[i]
print(s)


a = [list(input()) for i in range(3)]
print(a[0][0] + a[1][1] + a[2][2])


a = input()[0]
a += input()[1]
a += input()[2]
print(a)


c = [input()[_] for _ in range(3)]
print(''.join(c))


l = ''
for i in range(3):
	l += input()[i]
print(l)


(a, b, c) = [input() for _ in range(3)]
print(a[0], b[1], c[2], sep='')


x = input()
y = input()
z = input()
print(x[:1] + y[1:2] + z[-1])


t = input()
m = input()
b = input()
print(t[:1] + m[1:2] + b[2:])


a = input()
b = input()
c = input()
A = a[0]
B = b[1]
C = c[2]
print(A + B + C)


a = input()
b = input()
c = input()
print(a[0] + b[1] + c[2])


(x, y, z) = [input() for _ in range(3)]
print(x[0] + y[1] + z[2])


l = [input() for _ in range(3)]
print(l[0][0] + l[1][1] + l[2][2])


[a, b, c] = [input() for i in range(3)]
print(a[0] + b[1] + c[2])


A = input()
B = input()
C = input()
print(A[0] + B[1] + C[-1])


c = [input() for _ in range(3)]
print(c[0][0] + c[1][1] + c[2][2])


(S1, S2, S3) = [input() for _ in range(3)]
print(S1[0] + S2[1] + S3[2])


s = input()
s1 = input()
s2 = input()
print(s[0] + s1[1] + s2[2])


print(''.join((input()[i] for i in range(3))))


import sys
C = sys.stdin.readlines()
print(C[0][0] + C[1][1] + C[2][2])


s = input()
ss = input()
sss = input()
print(s[0] + ss[1] + sss[2])


S1 = input()
S2 = input()
S3 = input()
print(S1[0] + S2[1] + S3[2])


s = [list(input()) for _ in range(3)]
print(''.join([s[i][i] for i in range(3)]))


s = ''
for i in range(3):
	s += input()
print(s[0] + s[4] + s[8])


cs = []
for i in range(3):
	cs.append(input())
print(cs[0][0] + cs[1][1] + cs[2][2])


for _ in range(3):
	print(input()[_], end='')


def main():
	cat = ''.join
	data = cat((input() for _ in range(3)))
	print(cat([data[0], data[4], data[8]]))
main()


for i in range(3):
	print(input()[i], end='')
print()


(a, b, c) = [input()[i] for i in range(3)]
print(a + b + c)


a = ''
for i in range(3):
	a += input()[i]
print(a)


print(list(input())[0] + list(input())[1] + list(input())[2])


print(input()[0], input()[1], input()[2], sep='')


(a, b, c) = input()
(d, e, f) = input()
(g, h, i) = input()
print(a, e, i, sep='')


a = [input() for _ in range(3)]
print(a[0][0] + a[1][1] + a[2][2])


c = [input() for _ in range(3)]
for i in range(3):
	print(c[i][i], end='')


i = input
print(''.join((i()[0], i()[1], i()[2])))


s1 = input()
s2 = input()
s3 = input()
print(s1[0] + s2[1] + s3[2])


a = [list(input())[i] for i in range(3)]
print(''.join(a))


moji1 = str(input())
moji2 = str(input())
moji3 = str(input())
print(moji1[0] + moji2[1] + moji3[2])


S = [input() for _ in range(3)]
print(S[0][0] + S[1][1] + S[2][2])


l1 = input()
l2 = input()
l3 = input()
print(l1[0] + l2[1] + l3[2])


(s, t, u) = open(0)
print(s[0] + t[1] + u[2])


for i in range(3):
	s = list(input())
	print(s[i], end='')


c1 = str(input())
c2 = str(input())
c3 = str(input())
print(c1[0] + c2[1] + c3[2])


l = list((input() for i in range(3)))
print(l[0][0] + l[1][1] + l[2][2])


c1 = input()
c2 = input()
c3 = input()
s = c1[0] + c2[1] + c3[2]
print(s)


c = ''
for i in range(0, 3):
	f = input()
	c += f[i]
print(c)


print(str(input())[0] + str(input())[1] + str(input())[2])


ans = ''
for i in range(3):
	ans += input()[i]
print(ans)


c = input()
d = input()
e = input()
print(c[0] + d[1] + e[2])


s = input()
t = input()
u = input()
ans = s[0] + t[1] + u[2]
print(ans)


i = input()
j = input()
k = input()
print(i[0] + j[1] + k[2])


c = [list(input()) for i in range(3)]
print(c[0][0] + c[1][1] + c[2][2])


c = input() + input() + input()
print(c[0] + c[4] + c[8])


(C1, C2, C3) = open(0).read().split()
print(C1[0] + C2[1] + C3[2])


s = ''
s += input()[0]
s += input()[1]
s += input()[2]
print(s)


A = input()
S = input()
D = input()
print(A[0] + S[1] + D[2])


a = input()[0]
e = input()[1]
i = input()[2]
print(a + e + i)


ls = []
for i in range(3):
	ls.append(input())
ans = ''
for i in range(3):
	ans += ls[i][i]
print(ans)


S = [input() for i in range(3)]
print(S[0][0] + S[1][1] + S[2][2])


s = [input() for i in range(3)]
print(s[0][0] + s[1][1] + s[2][2])


print(input()[0:1] + input()[1:2] + input()[2:3])


print(''.join((input()[i] for i in (0, 1, 2))))


cij = [list(input()) for _ in range(3)]
print(cij[0][0] + cij[1][1] + cij[2][2])


x = input()
y = input()
z = input()
a = x + y + z
print(a[0::4])


f = input()
s = input()
t = input()
print(f[0] + s[1] + t[2])


c = []
for i in range(3):
	tmp = input()
	c.append(tmp)
ans = ''
for i in range(3):
	ans += c[i][i]
print(ans)


p = input()
q = input()
r = input()
print(p[0] + q[1] + r[2])


print(open(0).read()[0::5])


U = input()
M = input()
B = input()
print(U[0] + M[1] + B[2])


(c1, c2, c3) = [input() for i in range(3)]
print(c1[0] + c2[1] + c3[2])


c1 = list(map(str, input()))
c2 = list(map(str, input()))
c3 = list(map(str, input()))
print(c1[0] + c2[1] + c3[2])


c = ''
for i in range(3):
	c += input()[i]
print(c)


S = input()
T = input()
U = input()
print(S[0] + T[1] + U[2])


(A, B, C) = (input() for i in range(3))
print(A[0] + B[1] + C[2])


c = [str(input()) for i in range(3)]
w = c[0][0] + c[1][1] + c[2][2]
print(w)


for i in range(3):
	l = str(input())
	print(l[i], end='')


L1 = input()
L2 = input()
L3 = input()
print(L1[0] + L2[1] + L3[2])


c = input()
c2 = input()
c3 = input()
print(c[0] + c2[1] + c3[2])


import sys
a = input()
b = input()
c = input()
print(a[0] + b[1] + c[2])


x = [input() for _ in range(3)]
for i in range(3):
	print(x[i][i], end='')


C = [input() for _ in range(3)]
print(C[0][0] + C[1][1] + C[2][2])


res = ''
for i in range(3):
	line = input()
	res += line[i]
print(res)


c_lst = [str(input()) for _ in range(3)]
ans = ''
for i in range(3):
	ans += c_lst[i][i]
print(ans)


out = ''
for i in range(3):
	out += input()[i]
print(out)


l = []
for i in range(3):
	l.append(input())
print(l[0][0] + l[1][1] + l[2][2])


t = ''
for n in range(3):
	t += input()[n]
print(t)


s = input()
a = input()
c = input()
print(s[0] + a[1] + c[2])


A = [input() for i in range(3)]
print(A[0][0] + A[1][1] + A[2][2])


C = [input() for i in range(3)]
print(C[0][0] + C[1][1] + C[2][2])


c1 = input()
c2 = input()
c3 = input()
print(''.join(c1[0] + c2[1] + c3[2]))


a1 = input()
a2 = input()
a3 = input()
print(a1[0] + a2[1] + a3[2])


print(input()[0] + input()[1] + input()[2])


s_1 = input()
s_2 = input()
s_3 = input()
print(s_1[0] + s_2[1] + s_3[2])


s = input()
a = input()
b = input()
print(s[0] + a[1] + b[2])


s = open(0).read().split()
print(s[0][0] + s[1][1] + s[2][2])


(c1, c2, c3) = open(0).read().split()
print(c1[0] + c2[1] + c3[2])


N_list = []
for i in range(3):
	N = input()
	N_i = N[0:3]
	N_list.append(N_i)
	i += 1
print(N_list[0][0] + N_list[1][1] + N_list[2][2])


a = map(str, input().split())
line_a = ''.join(a)
b = map(str, input().split())
line_b = ''.join(b)
c = map(str, input().split())
line_c = ''.join(c)
print('{}{}{}'.format(line_a[0], line_b[1], line_c[2]))


n = input()
l = input()
m = input()
print(n[0] + l[1] + m[2])


n = list(input())
n1 = list(input())
n2 = list(input())
print(n[0] + n1[1] + n2[2])


c1 = list(input())
c2 = list(input())
c3 = list(input())
print(c1[0] + c2[1] + c3[2])


N = input()
H = input()
K = input()
print(N[0] + H[1] + K[2])


c = [list(input())[i] for i in range(3)]
print(''.join(c))


S = ''
S += input()[0]
S += input()[1]
S += input()[2]
print(S)


S0 = input()
S1 = input()
S2 = input()
print(S0[0] + S1[1] + S2[2])


def main():
	c = [input() for _ in range(3)]
	print(c[0][0] + c[1][1] + c[2][2])

def __starting_point():
	main()
__starting_point()


a = input()[0]
s = input()[1]
d = input()[2]
print(a + s + d)


x = ''
r = range(3)
for i in r:
	x += list(input())[i]
print(x)


a = input() + input() + input()
print(a[::4])


C1 = input()
C2 = input()
C3 = input()
print(C1[0] + C2[1] + C3[-1])


(a, b, c) = input()
(e, f, g) = input()
(h, i, j) = input()
print(a + f + j)


ans = ''
for x in range(3):
	ans += input()[x]
print(ans)


import sys
from io import StringIO
import unittest

class TestClass(unittest.TestCase):

	def assertIO(self, input, output):
		(stdout, stdin) = (sys.stdout, sys.stdin)
		(sys.stdout, sys.stdin) = (StringIO(), StringIO(input))
		resolve()
		sys.stdout.seek(0)
		out = sys.stdout.read()[:-1]
		(sys.stdout, sys.stdin) = (stdout, stdin)
		self.assertEqual(out, output)

	def test_入力例_1(self):
		input = 'ant\nobe\nrec'
		output = 'abc'
		self.assertIO(input, output)

	def test_入力例_2(self):
		input = 'edu\ncat\nion'
		output = 'ean'
		self.assertIO(input, output)

def resolve():
	C1 = input()
	C2 = input()
	C3 = input()
	print(C1[0] + C2[1] + C3[2])

def __starting_point():
	resolve()
__starting_point()


n = [input() for i in range(3)]
print(n[0][0] + n[1][1] + n[2][2])


i1 = input()
i2 = input()
i3 = input()
print(str(i1[0]) + str(i2[1]) + str(i3[2]))


a = input()
f = input()
j = input()
print(a[0] + f[1] + j[2])


print(*[input()[i] for i in range(3)], sep='')


n = input()
n1 = input()
n2 = input()
print(n[0], n1[1], n2[2], flush=True, sep='')


for i in range(3):
	hoge = input()
	print(hoge[i:i + 1], end='')


d = ''
for i in range(3):
	s = str(input())
	d += s[i]
print(d)


s = open(0).read()
print(s[0] + s[5] + s[10])


c0 = input()
c1 = input()
c2 = input()
print(c0[0] + c1[1] + c2[2])


def resolve():
	matrix = []
	for i in range(3):
		line = input()
		matrix.append(line)
	ans = ''
	for i in range(3):
		ans += matrix[i][i]
	print(ans)
resolve()


print('{}{}{}'.format(input()[0], input()[1], input()[2]))


c = input()[0]
c += input()[1]
c += input()[2]
print(c)


s = input()
t = input()
r = input()
print(s[0] + t[1] + r[2])


r = ''
for i in range(3):
	r += input()[i]
print(r)


ans = ''
ans += input()[0]
ans += input()[1]
ans += input()[2]
print(ans)


Str = [input()[I] for I in range(0, 3)]
print(''.join(Str))


import sys
s = sys.stdin.read().split()
print(s[0][0] + s[1][1] + s[2][2])


(a, b, c) = open(0)
print(a[0] + b[1] + c[2])


(i, j, k) = open(0).read().split()
print(i[0] + j[1] + k[2])


l = input()[0]
l += input()[1]
l += input()[2]
print(l)


x = [input() for i in range(3)]
print(x[0][0] + x[1][1] + x[2][2])


f = lambda i: input()[i]
print(f(0) + f(1) + f(2))


D = input
print(D()[0] + D()[1] + D()[2])


A = list(input())
B = list(input())
C = list(input())
print(f'{A[0]}{B[1]}{C[2]}')


c1 = input()
c2 = input()
c3 = input()
print(c1[0], end='')
print(c2[1], end='')
print(c3[2])


p = input
print(p()[0] + p()[1] + p()[2])


i = input
print((i() + i() + i())[::4])


C = open(0).read().split()
print(C[0][0] + C[1][1] + C[2][2])


print((input() + input() + input())[::4])


str = ''
for i in range(3):
	str += input()[i]
print(str)


ans = []
for i in range(3):
	c = input()
	ans.append(c[i])
print(''.join(ans))


(a, b, c) = map(list, open(0))
print(a[0] + b[1] + c[2])


b = [input() for i in range(3)]
print(b[0][0] + b[1][1] + b[2][2])


A = ''
A += input()[0]
A += input()[1]
A += input()[2]
print(A)


A = input()
B = input()
C = input()
X = A[0] + B[1] + C[2]
print(X)


str1 = input()
str2 = input()
str3 = input()
print(str1[0] + str2[1] + str3[2])