As you can't hide information in the blockchain you have to use other means.
If you are familiar with how the mining process works we can use the same logic here. The whole point of the mining (mathematically speaking) is that the actual mining is hard but verifying the results is trivial. So once a miner successfully mines a block he publishes the nonce used to mine the block - everyone else can just trivially check that the nonce is the correct one.
So in your case you can ask the participants to hash their inputs and submit the hash values. As it's impossible to get the input from the hash value the data is safe. When both have submitted their hash values they state their actual inputs and both parties can easily verify that the input results in the correct hash.
Depending on your input structure you probably also want to include some sort of salt value. For example if the input is simply a number between 1 and 10 it's easy for the other party to bruteforce all the 10 hash values to see which is the correct input and abuse that information. But if you include also some salt value it becomes unfeasible for the other party to try to bruteforce the input.
Here's some more info on salt: https://en.wikipedia.org/wiki/Salt_(cryptography)