P09 solved.
P09 with standard library.