Definition: Given an entity, a before event, an after event, and an attribute related to the entity, generate a sentence as output. Your sentence should show the changes in the attribute of the entity.
Input: entity: code 
before: blue, orange(2), blue, orange(2), blue, orange(2), blue 
after: blue, yellow, orange, red, orange, yellow, red, yellow, red 
attr: state

state of code was blue, orange(2), blue, orange(2), blue, orange(2), blue before and blue, yellow, orange, red, orange, yellow, red, yellow, red afterwards