In a convex quadrilateral ABCD, all the triangles △ABC, △BCD, △CDA and △DAB have equal perimeters. Show that ABCD is a rectangle.