import java.util.Scanner;
public class Main{
public static void main
(String[] args
) { int valor[] = new int[5];
int i;
Scanner in
= new Scanner
(System.
in);
for (i = 0; i < valor.length; i++) {
valor[i] = in.nextInt();
if (valor[i] >= 100){
valor[i] = valor[i] = in.nextInt();
}
}
i = 0;
while(i < valor.length &&valor[i] != 42){
i++;
}
}
}
aW1wb3J0IGphdmEudXRpbC5TY2FubmVyOwoKcHVibGljIGNsYXNzIE1haW57CglwdWJsaWMgc3RhdGljIHZvaWQgbWFpbihTdHJpbmdbXSBhcmdzKSB7CgkJaW50IHZhbG9yW10gPSBuZXcgaW50WzVdOwoJCWludCBpOwoJCVNjYW5uZXIgaW4gPSBuZXcgU2Nhbm5lcihTeXN0ZW0uaW4pOwoJCQoJCWZvciAoaSA9IDA7IGkgPCB2YWxvci5sZW5ndGg7IGkrKykgewoJCQkKCQkJdmFsb3JbaV0gPSBpbi5uZXh0SW50KCk7CgkJCQoJCQlpZiAodmFsb3JbaV0gPj0gMTAwKXsKCQkJCQoJCQkJdmFsb3JbaV0gPSB2YWxvcltpXSA9IGluLm5leHRJbnQoKTsKCQkJfQkJCgkJfQoJCQoJCWkgPSAwOwoJCXdoaWxlKGkgPCB2YWxvci5sZW5ndGggJiZ2YWxvcltpXSAhPSA0Mil7CgkJCVN5c3RlbS5vdXQucHJpbnRsbih2YWxvcltpXSk7CgkJCWkrKzsKCQl9Cgl9Cn0=