Structurally identical tree

i am not able to crack how to take input
means when to take string value and when to take int