We put the details of component in final output array
a . append ( j ) NEW_LINE b . append ( w ) NEW_LINE c . append ( ans ) NEW_LINE print ( len ( a ) ) NEW_LINE for j in range ( len ( a ) ) : NEW_LINE print ( a [ j ] , b [ j ] , c [ j ] ) NEW_LINE