import java.util.Scanner;
// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
// 注意 hasNext 和 hasNextLine 的区别
while (in.hasNext()) { // 注意 while 处理多个 case
String s = in.next();
String t = in.next();
int res = process(s, t);
System.out.println(res);
}
}
private static int process(String s, String t) {
if (s.length() < t.length()) {
String tmp = t;
t = s;
s = tmp;
}
int sEnd = s.length()-1;
int tEnd = t.length()-1;
while (sEnd >= 0 ) {
while (sEnd >= 0 && tEnd >= 0 && s.charAt(sEnd) == t.charAt(tEnd)) {
sEnd--;
tEnd--;
}
if (tEnd < 0) return 1;
tEnd = t.length()-1; // 此处开始找下一个相同的点进行比较
sEnd--;
}
return 0;
}
}