#include <iostream>
#include <vector>
using namespace std;
signed main() {
int n,m;
cin >> n >> m;
vector<vector<int>> a(n,vector<int>(m));
vector<pair<int,int>> ans;
for(int i = 0; i < n; i++){
for(int j = 0; j < m; j++){
cin >> a[i][j];
if(a[i][j] < 0)
ans.push_back({i,j});
}
for(auto i: ans)
cout << a[i.first][i.second] << '(' << i.first << ',' << i.second << ")\n";
#include <iostream>
#include <vector>
using namespace std;
signed main() {
int n,m;
cin >> n >> m;
vector<vector<int>> a(n,vector<int>(m));
vector<pair<int,int>> ans;
for(int i = 0; i < n; i++){
for(int j = 0; j < m; j++){
cin >> a[i][j];
if(a[i][j] < 0)
ans.push_back({i,j});
}
}
for(auto i: ans)
cout << a[i.first][i.second] << '(' << i.first << ',' << i.second << ")\n";
}