program m_mod_k;
var k,m,x,y: integer;
begin
read(m,k);
x:=m; y:=k;
while x >= y do
x := x - y;
writeln(m,' mod ',k,' = ', x)
end.
cHJvZ3JhbSBtX21vZF9rOwp2YXIgayxtLHgseTogaW50ZWdlcjsKICAgIApiZWdpbgogICAgcmVhZChtLGspOwogICAgeDo9bTsgeTo9azsKICAgIHdoaWxlIHggPj0geSBkbwogICAgCXggOj0geCAtIHk7CiAgICB3cml0ZWxuKG0sJyBtb2QgJyxrLCcgPSAnLCB4KQplbmQu