#include <iostream>

using namespace std;

/*bool isFullnum (int n){
	int sum = 0;
	for (int i = 1; i < n; i++){
		if (n % i == 0){
			sum += i;
		}
	}
	return sum == n;
}

int main () {
	int a, b;
	while (cin >> a >> b){
		for (int i = a; i <= b; i++){
			if (isFullnum(i)){
				cout << i << endl;
			}
		}
	}
	return 0;
}*/
int arr[4] = {6, 28, 496, 8128};

int main () {
    int a, b;
    while (cin >> a >> b){
        for (int i = 0; i < 4; i++){
            if (arr[i] >= a && arr[i] <= b){
                cout << arr[i] << endl;
            }
        }
    }
    return 0;
}