import java.util.*;

public class five_mhargrove
{
    public static void main(String[] args)
    {
        Scanner in = new Scanner(System.in);
        int cases = in.nextInt();
        for (int i = 0; i < cases; i++)
        {
            in.nextInt();
            int num = in.nextInt();
            System.out.println(num + " " + 5);
        }
    }
}