while dad work little girl Tanya decide play dad password secret database dad password string consist n2 character she write possible n threeletter continuous substring password piece paper piece paper throw password each threeletter substre write number time occur password Thus Tanya end n piece paperthen Tanya realize dad upset learn game decide restore password string correspond final set threeletter string you help difficult task we know dad password consist lowercase uppercase letter Latin alphabet digit Uppercase lowercase letter latin alphabet consider distinct