HDACM1196
import java.util.Scanner;public class Main{public static void main(String[] args) {Scanner sc = new Scanner(System.in);while (sc.hasNext()) {int a = sc.nextInt();if (a==0) {break;}int i = 1;while (a%2==0) {a /= 2;i *= 2;}System.out.println(i);}}
}