SPOJ.com - Problem QTREE

Getting Runtime error in QTREE(Spoj Problem) even with only inputs in java.
Is there any problem with its test data??
Please help me out…