print and iterate only once