Print duplicate only lines as normal output - Awk

input

output

a1	100	200	XYZ_X
a1	98	188	ABC

Something like this,

awk '{if (a[$0]) { print $0} else {a[$0]=++i;}}' input.txt

OR

uniq -d input.txt

Is it possible modify some thing like this
Just print the middle value that has
one small value set and [a1 100 200 XYZ_X]
high value set [a1 600 800 XYZ_X]

input

a1	100	200	XYZ_X
a1	300	400	XYZ_X
a1	600	800	XYZ_X
a1	9	79	ABC
a1	98	108	ABC
a1	108	188	ABC
a2	100	200	XYZ_X

output1- middle value

a1	300	400	XYZ_X
a1	98	108	ABC

output2 - small value of middle value

a1	100	200	XYZ_X
a1	9	79	ABC

output3 - High value of middle value

a1	600	800	XYZ_X
a1	108	188	ABC