The simplest method would be to use a string variable.
Each input set the variable to the current value and the new input.
On input variableString set value to variableString& input
You would also need a counter to tell it when to check.
When it's time to check, compare varaibleString to another variable with the correct order.