import java.io.*;
import java.util.*;

public class sequence_at implements Runnable {
	BufferedReader in;
	StringTokenizer st;
	PrintWriter out;
	
	private long pow(long a) {
		if (a == 0) {
			return 1;
		}
		if (a % 2 == 0) {
			long b = pow(a / 2);
			return b * b;
		}
		return 2 * pow(a - 1);
	}
	
	private long calcLen(long a) {
		if (a >= 62) {
			return Long.MAX_VALUE;
		}
		else {
			return pow(a) - 1;
		}
	}
	
	public void solve() throws Exception {
		int n = (int)nextLong();
		for(int i = 0; i < n; ++i) {
			long a = nextLong();
			long b = nextLong();
			long len = calcLen(b);
			if (a > len) {
				out.println("No solution");
			}
			else {
				int result = 1;
				while(a % 2 == 0) {
					++result;
					a = a / 2;
				}
				out.println(result);
			}
		}
	}
	
	public void run() {
		try {
			solve();
		} catch (Exception e) {
			e.printStackTrace();
			System.exit(89);
		} finally {
			out.close();
		}
	}

	public sequence_at(String name) {
		try {
			in = new BufferedReader(new FileReader(name + ".in"));
			st = new StringTokenizer("");
			out = new PrintWriter(new File(name + ".out"));
		} catch (Exception e) {
			e.printStackTrace();
			System.exit(89);
		}
	}
	public static void main(String[] args) {
		(new Thread(new sequence_at("sequence"))).start();
	}
	
	private String nextToken() throws IOException {
		while(!st.hasMoreTokens()) {
			st = new StringTokenizer(in.readLine());
		}
		return st.nextToken();
	}
	
	private long nextLong() throws Exception {
		return Long.parseLong(nextToken());
	}
}