Skip to main content
2 of 5
added 113 characters in body; added 149 characters in body

J, 146 132 (Secretly breaks on certain answers)

n=:}:m=:|:".>{.`(<@}:@;@(1 2&{))`{:(`:0)"1;:;._2(1!:1)3 k=:3 :0 ')',~'(',','4}4j2 5j2":,(,.{:m)%.n ) echo'parallel'"_`k@.(*|-/ .*n)0 

Parsing here is awful. I'm still trying to cook up a solution with ;:, but it may not happen tonight.

Edit: Realized that my output is basically broken, although it works for the examples given and parallels...

Edit: Posting the shorter version I already had. Probably not going to fix the output tonight.