/* Codeforces Round 971 (Div. 4) Problem : https://codeforces.com/contest/2009/problem/B Solution: https://aruljohn.com/blog/osu-mania-problem/ */ #include #include using namespace std; // Main function int main() { int t; cin >> t; for (int i=0; i < t; i++) { int n; string note; cin >> n; vector notes; for (int j=0; j < n; j++) { cin >> note; notes.push_back(note); } reverse(notes.begin(), notes.end()); for (int j=0; j < n; j++) { int notepos = notes[j].find('#'); cout << notepos + 1 << " "; } cout << "\n"; } }