import java.util.*;
public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int[] w = {1,2,4,8,16,32,64}; 
out:		for(int i = N; i > 0; i--) {
			for(int j = w.length - 1; j >= 0; j--) {
				if(i == w[j]) {
					System.out.println(w[j]);
					break out;
				}
			}
		}
	}
} import java.util.*; util.* java public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int[] w = {1,2,4,8,16,32,64}; 
out:		for(int i = N; i > 0; i--) {
			for(int j = w.length - 1; j >= 0; j--) {
				if(i == w[j]) {
					System.out.println(w[j]);
					break out;
				}
			}
		}
	}
} Main public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int[] w = {1,2,4,8,16,32,64}; 
out:		for(int i = N; i > 0; i--) {
			for(int j = w.length - 1; j >= 0; j--) {
				if(i == w[j]) {
					System.out.println(w[j]);
					break out;
				}
			}
		}
	} main {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int[] w = {1,2,4,8,16,32,64}; 
out:		for(int i = N; i > 0; i--) {
			for(int j = w.length - 1; j >= 0; j--) {
				if(i == w[j]) {
					System.out.println(w[j]);
					break out;
				}
			}
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int[] w = {1,2,4,8,16,32,64}; w {1,2,4,8,16,32,64} 1 2 4 8 16 32 64 String[] args args public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int[] w = {1,2,4,8,16,32,64}; 
out:		for(int i = N; i > 0; i--) {
			for(int j = w.length - 1; j >= 0; j--) {
				if(i == w[j]) {
					System.out.println(w[j]);
					break out;
				}
			}
		}
	}
} public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int[] w = {1,2,4,8,16,32,64}; 
out:		for(int i = N; i > 0; i--) {
			for(int j = w.length - 1; j >= 0; j--) {
				if(i == w[j]) {
					System.out.println(w[j]);
					break out;
				}
			}
		}
	}
} Main
import java.util.*;
public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int[] w = {1,2,4,8,16,32,64}; 
out:		for(int i = N; i > 0; i--) {
			for(int j = w.length - 1; j >= 0; j--) {
				if(i == w[j]) {
					System.out.println(w[j]);
					break out;
				}
			}
		}
	}
}