program Diofant;
var
n, x, y: integer;
begin
n := 125;
{3x + 5y = n, n >= 0, x >= 0, y >= 0;
n - 5y >= 0, y <= n / 5}
for y := 0 to n div 5 do
if (n - 5 * y) mod 3 = 0 then
x := (n - 5 * y) div 3;
Writeln('3 * ', x, ' + 5 * ', y, ' = ', n)
end;
Readln;
end.
program Diofant;
var
n, x, y: integer;
begin
n := 125;
{3x + 5y = n, n >= 0, x >= 0, y >= 0;
n - 5y >= 0, y <= n / 5}
for y := 0 to n div 5 do
begin
if (n - 5 * y) mod 3 = 0 then
begin
x := (n - 5 * y) div 3;
Writeln('3 * ', x, ' + 5 * ', y, ' = ', n)
end;
end;
Readln;
end.