#include <iostream>

int closestPower(int x) {
    if (x == 0) return 0;
    int a = 1;
    while (x >= 2*a) {
        a *= 2;
    }
    if (2*a - x <= x - a) return 2*a;
    return a;
}

int bitConversion(int a, int b) {
    int res = 0;
    while (b > 0) {
        int aBit = a%2;
        int bBit = b%2;
        if (aBit != bBit) res++;
        a /= 2;
        b /= 2;
    }
    return res;
}

class Problem
{
public:
    static int* flipShift(int a, int b)
    {
        //
        // Implement your solution here
        //
        int *arr = new int[3];
        int aPrime = closestPower(a), bPrime = closestPower(b);
        // std::cout << aPrime << " " << bPrime << std::endl;
        arr[0] = bitConversion(std::min(aPrime,a),std::max(aPrime,a));
        arr[1] = bitConversion(std::min(bPrime,b),std::max(bPrime,b));
        arr[2] = 0;
        if (aPrime == 0) aPrime = 1;
        while (aPrime < bPrime) {
            aPrime <<= 1;
            arr[2]++;
        }
        // std::cout << arr[0] << " " << arr[1] << " " << arr[2] << std::endl;
        return arr;

    }
};

#ifndef RunTests
int main()
{
    // test your code if you wish
    std::cout << Problem::flipShift(2, 1);
}
#endif