solve ARC016 D