i dont really understand this problem, specially the set of inputs which has been given.
@Sakshi_Suman please refer to this code.