print by q function