solve input