x=1;
while ~(mod(x,3)==1 && mod(x,4)==2 && mod(x,5)==3 && mod(x,6)==4)
    x=x+1;
end
disp(x)