import java.io.BufferedReader; import java.io.InputStreamReader; public class prog { public boolean check(String string) { char[] one = string.split(" ")[0].toCharArray(); char[] two = string.split(" ")[1].toCharArray(); char[] three = string.split(" ")[2].toCharArray(); if (one.length == 1 && one[0] == '0' && two.length == 1 && two[0] == '0' && three.length == 1 && three[0] == '0') { return false; } for (int i = 0; i < one.length; i++) { if (one[i] == two[0]) { one[i] = three[0]; } } String fin = ""; for (int i=0;i