program mika;
var b,c,z,x,k:integer;
begin
if (b<=256) and (b<500) and (b>=0) and (c<=256) and (c<500) and (c>=0) 
then
writeln ('unesite dva rezultata');
readln (b,c);
x:=256-b;
z:=256-c;
if (x<=z) and (z<=x)
then k:=x
else k:=z;
writeln ('k=,k');
readln;
end.