N = int(input()) i = 1 while i <= N: i *= 2 print(i//2)