1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
var n, m, p: qword; begin read(n, m); while m <> 0 do begin p := n mod m; n := m; m := p end; writeln(n <> 1) end.