String compare(String s1, String s2)
    {
        String rst = "";
        int count = 0;
        int a = Math.min(s1.length(), s2.length() );
        for(int i=0;i<a;i++)
        {
            if(s1.charAt(i) == s2.charAt(i))
                count++;
            else
                break;
        }
        if(count!=0)
            return s1.substring(0, count);
        return rst;
    }