#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int di[4] = {-1, 1, 0, 0};
int dj[4] = {0, 0, -1, 1};
void solve(int T) {
int n, m; cin >> n >> m;
vector<string> s(n);
vector<vector<bool>> visited(n, vector<bool>(m, false));
for(auto &x : s) cin >> x;
int ans = 0, cnt = 0;
for(int i = 0; i < n; i++) {
for(int j = 0; j < n; j++) {
if(s[i][j] == '0' && !visited[i][j]) {
queue<pair<int,int>> que;
que.push({i,j});
visited[i][j] = true;
cnt = 0;
while(!que.empty()) {
cnt++;
auto p = que.front();
que.pop();
int ti = p.first;
int tj = p.second;
for(int k = 0; k < 4; k++) {
int ni = ti + di[k];
int nj = tj + dj[k];
if(ni < n && ni >= 0
&& nj < m && nj >= 0
&& !visited[ni][nj] && s[ni][nj] == '0') {
que.push({ni,nj});
visited[ni][nj] = true;
}
}
}
ans = max(ans, cnt);
}
}
}
cout << "Floor #" << T << ": " << ans << "\n";
}
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
#ifdef MYPC
cout << "==== OUTPUT ====\n";
#endif
int t; cin >> t;
for(int i = 1; i <= t; i++) {
solve(i);
}
}