Group inputs by destination