int input ans for in range input split if int 30 and int 30 ans append

1
2
3
4
5
6
7
n = int(input())
ans = []
for i in range(n):
a,b,c,d = input().split()
if int(c) < 30 and int(d) < 30: ans.append(a+' '+b)
ans = sorted(ans)
for i in ans: print(i)