write print function