operator<< overloaded for Terminal class