#include <iostream>
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, cases = 1, a[3];
cin >> n;
while (cases != n + 1) {
cin >> a[0] >> a[1] >> a[2];
sort(a, a + 3);
cout << "Sorted array: " << a[0] << " " << a[1] << " " << a[2] << endl;
cout << "Case " << cases << ": " << a[1] << endl;
cases++;
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8Yml0cy9zdGRjKysuaD4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmludCBtYWluKCkgewoJaW50IG4sIGNhc2VzID0gMSwgYVszXTsKCWNpbiA+PiBuOwoJd2hpbGUgKGNhc2VzICE9IG4gKyAxKSB7CgkgICAgY2luID4+IGFbMF0gPj4gYVsxXSA+PiBhWzJdOwoJICAgIHNvcnQoYSwgYSArIDMpOwoJICAgIGNvdXQgPDwgIlNvcnRlZCBhcnJheTogIiA8PCBhWzBdIDw8ICIgIiA8PCBhWzFdIDw8ICIgIiA8PCBhWzJdIDw8IGVuZGw7CgkgICAgY291dCA8PCAiQ2FzZSAiIDw8IGNhc2VzIDw8ICI6ICIgPDwgYVsxXSA8PCBlbmRsOwoJICAgIGNhc2VzKys7Cgl9CglyZXR1cm4gMDsKfQ==