T = n mod 10; if (n mod t = 0) then writeln(t); t = n div 10 mod 10; if (n mod t = 0) then writeln(t); t = n div 100 mod 10; if (n mod t = 0) then writeln(t); t = n div 1000 mod 10; if (n mod t = 0) then writeln(t);