#include <bits/stdc++.h>
using namespace std;
string ats[201][201];
bool legit(int m, int w) {
  int a = 0, b = 0;
  bitset<8> bits(w);
  for (int j = 0; j < m; j++) {
    if (bits[j])
      a++;
    else
      b++;
    if (max(a, b) == 3 && j + 1 != m) return 0;
  }
  return max(a, b) == 3;
}
bool tryGen(int a, int b, vector<int>& A, vector<int>& B, int m, int w, int g) {
  int lim[] = {25, 25, 25, 25, 15};
  bitset<8> bits(w);
  for (int j = 0; j < m; j++)
    if (bits[j]) {
      a -= lim[j];
      A[j] += lim[j];
    } else {
      b -= lim[j];
      B[j] += lim[j];
    }
  if (a < 0 || b < 0) return 0;
  for (int j = g; j <= g; j++)
    if (bits[j]) {
      while (b > 0 && B[j] < lim[j] - 2) b--, B[j]++;
      while (b > 0 && a > 0 && abs(B[j] - A[j]) == 2 && j == g)
        a--, b--, A[j]++, B[j]++;
    } else {
      while (a > 0 && A[j] < lim[j] - 2) a--, A[j]++;
      while (b > 0 && a > 0 && abs(B[j] - A[j]) == 2 && j == g)
        a--, b--, A[j]++, B[j]++;
    }
  for (int j = m - 1; j >= 0; j--)
    if (bits[j]) {
      while (b > 0 && B[j] < lim[j] - 2) b--, B[j]++;
      while (b > 0 && a > 0 && abs(B[j] - A[j]) == 2 && j == g)
        a--, b--, A[j]++, B[j]++;
    } else {
      while (a > 0 && A[j] < lim[j] - 2) a--, A[j]++;
      while (b > 0 && a > 0 && abs(B[j] - A[j]) == 2 && j == g)
        a--, b--, A[j]++, B[j]++;
    }
  vector<int> fA, fB, s;
  for (int j = m - 1; j >= 0; j--)
    if (j == g)
      continue;
    else if (bits[j])
      fB.push_back(j);
    else
      fA.push_back(j);
  if (abs(B[g] - A[g]) == 2) s.push_back(g);
  while (a > 0 && !s.empty() && !fB.empty() && b == 0) {
    int ss = s.back();
    int bb = fB.back();
    fB.pop_back();
    while (B[bb] > 0 && a > 0) B[bb]--, B[ss]++, A[ss]++, a--;
  }
  while (b > 0 && !s.empty() && !fA.empty() && a == 0) {
    int ss = s.back();
    int aa = fA.back();
    fA.pop_back();
    while (A[aa] > 0 && b > 0) A[aa]--, A[ss]++, B[ss]++, b--;
  }
  return a == 0 && b == 0;
}
void gen() {
  for (int a = 0; a < 201; a++)
    for (int b = 0; b < 201; b++) {
      ats[a][b] = "Impossible\n";
      int best = -10;
      for (int m = 3; m <= 5; m++)
        for (int w = 0; w < (1 << m); w++)
          if (legit(m, w)) {
            vector<int> A(m), B(m);
            for (int k = 0; k < m; k++)
              if (tryGen(a, b, A, B, m, w, k)) {
                int win = bitset<8>(w).count();
                int lose = m - win;
                if (win - lose > best) {
                  best = win - lose;
                  ats[a][b] =
                      "" + to_string(win) + ":" + to_string(lose) + "\n";
                  for (int j = 0; j < m; j++)
                    ats[a][b] += "" + to_string(A[j]) + ":" + to_string(B[j]) +
                                 (j + 1 == m ? "\n" : " ");
                }
              }
          }
    }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  gen();
  int t, a, b;
  cin >> t;
  while (t--) {
    cin >> a >> b;
    cout << ats[a][b];
  }
}
