Wrong test case given! The last test case checks for 'wq' and output must be 'w'. But it checks for output as 'wq'. Please correct the problem!