#include <cstdio>
#include <cstring>
#include <algorithm>
#include <map>
using namespace std;

int T, ans;
int h[4], m[4];

int times[4];

bool mark[13][70];

void DFS(int pos)
{
    if (pos == 3)
    {
        int f[4];
        for (int i = 1; i <= 3; ++i) f[i] = times[i];
        sort(f + 1, f + 4);
        int det1 = f[2] - f[1], det2 = f[3] - f[2];
        if (det1 == det2)
        {
            int hh = f[2] / 60, tt = f[2] % 60;
            if (hh > 12) hh -= 12;
            else if (hh == 0) hh = 12;
            mark[hh][tt] = 1;
        }
        return;
    }

    int l = pos + 1;
    if (h[l] == 12)
    {
        times[l] = h[l] * 60 + m[l];
        DFS(pos + 1);
        times[l] = (h[l] - 12) * 60 + m[l];
        DFS(pos + 1);
    }
    else
    {
        times[l] = h[l] * 60 + m[l];
        DFS(pos + 1);
        times[l] = (h[l] + 12) * 60 + m[l];
        DFS(pos + 1);
    }
}

int main()
{
    scanf("%d", &T);
    while (T--)
    {
        memset(mark, 0, sizeof (mark));
        ans = 0;
        for (int i = 1; i <= 3; ++i)
            scanf("%d:%d", h + i, m + i);
        DFS(0);
        int tm, th;
        for (int i = 1; i <= 12; ++i)
            for (int j = 0; j < 60; ++j)
            {
                if (mark[i][j])
                {
                    ans++;
                    tm = i, th = j;
                }
            }
        if (ans == 1)
        {
            printf("The correct time is %d:%02d\n", tm, th);
        }
        else puts("Look at the sun");
    }
    return 0;
}
