Java: P21
Java: P15
P22: Java (messy, but works)