Recently Luba learned about a special kind of numbers that she calls beautiful numbers. The number is called beautiful iff its binary representation consists of *k* + 1 consecutive ones, and then *k* consecutive zeroes.

Some examples of beautiful numbers: 
 -  1<sub class="lower-index">2</sub> (1<sub class="lower-index">10</sub>); -  110<sub class="lower-index">2</sub> (6<sub class="lower-index">10</sub>); -  1111000<sub class="lower-index">2</sub> (120<sub class="lower-index">10</sub>); -  111110000<sub class="lower-index">2</sub> (496<sub class="lower-index">10</sub>). 
More formally, the number is beautiful iff there exists some positive integer *k* such that the number is equal to (2<sup class="upper-index">*k*</sup> - 1) * (2<sup class="upper-index">*k* - 1</sup>).

Luba has got an integer number *n*, and she wants to find its greatest beautiful divisor. Help her to find it!
The only line of input contains one number *n* (1 ≤ *n* ≤ 10<sup class="upper-index">5</sup>) — the number Luba has got.
none
3
1
992
496
81142
1
76920
120
2016
2016
1
1
6
6
32640
32640
12096
2016
55948
1
47262
6
22876
28
96120
120
42160
496
38304
2016
89408
8128
97920
32640
55493
1
38021
1
21445
1
100000
1
497
1
240
120
21204
6
65536
1
364
28
1024
1
36
6
28
28
14400
120
10080
2016
9
1
2
1
42
6
83160
120
65534
1
1026
6
1025
1
1027
1
2018
1
2020
1
123
1
150
6
5
1
66
6
12768
28
156
6
99990
6
248
1
#include <bits/stdc++.h>
#define cases int T; cin >> T; while(T--)
#define loop(m) for(int i = 0; i < m; i++)
#define yes cout << "YES\n"
#define no cout << "NO\n"
#define nl '\n'
#define eb emplace_back
#define speed() ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
typedef long long ll;
using namespace std;

int main()
{
    speed();
    int n;
    cin >> n;
    vector<int> powers;
    for (int i = 0; i <= 17; i++)
        powers.eb(pow(2, i));
    vector<int> divisors;
    for (int i =sqrt(n); i >= 1; i--)
    {
        if (n % i == 0)
        {
            if (i != n / i)
                divisors.eb(n / i);
        }
    }
    for (int i = 1; i * i <= n; i++)
    {
        if (n % i == 0)
        {
            divisors.eb(i);
        }
    }
    for (int i = 0; i < divisors.size(); i++)
    {
        for (int j=1; j<powers.size(); j++)
            if((powers[j]-1)*powers[j-1]==divisors[i])
            {
                cout<<divisors[i];
                return 0;
            }
    }
    return 0;
}


