Moreover some ferrymen are very lazy. Tiribaki women would like to have a table, which tells for each pair of island, how much time the shortest path takes. Assume, that time necessary to wait for a boat is neglectable. In the SoDr software house they have many problems with the new customer again. He bought a computer which could use only one character variable.
Customer wants to place the computer to the frontier.
Each time somebody cross the border from the first side to the second one, the computer gets character A as an input. Otherwise it is necessary to alarm. A and B terminated by space. Write the program, which determines, whether the number of As and Bs in the sequence is the same or not. Do not forget that your program can use only one character variable and its content can be changed only by reading from the input.