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: cap 
before: on pen 
after: off of pen 
attr: location

location of cap was on the pen before and off of the pen afterwards