#include <iostream>
using namespace std;
int main() {
int n,m;
cin >> n >> m;
double A[n][m];
for (int i = 0; i < n; i++){
for (int j = 0; j < m; j++)
cin >> A[i][j];
}
for (int i = 0; i < n; i++){
for (int j = 0; j < m; j++)
if (A[i][j]!=0){
A[i][j]=-(1/A[i][j]);
}
}
for (int i = 0; i < n; i++){
for(int j = 0; j < m; j++)
cout << A[i][j] << "\t";
cout << endl;
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwogCmludCBtYWluKCkgewoJaW50IG4sbTsKCWNpbiA+PiBuID4+IG07Cglkb3VibGUgQVtuXVttXTsKCWZvciAoaW50IGkgPSAwOyBpIDwgbjsgaSsrKXsKCQlmb3IgKGludCBqID0gMDsgaiA8IG07IGorKykKCQkJY2luID4+IEFbaV1bal07Cgl9Cglmb3IgKGludCBpID0gMDsgaSA8IG47IGkrKyl7CgkJZm9yIChpbnQgaiA9IDA7IGogPCBtOyBqKyspCgkJCWlmIChBW2ldW2pdIT0wKXsKCQkJCUFbaV1bal09LSgxL0FbaV1bal0pOwoJCQl9Cgl9CQoJZm9yIChpbnQgaSA9IDA7IGkgPCBuOyBpKyspewoJCWZvcihpbnQgaiA9IDA7IGogPCBtOyBqKyspCgkJCWNvdXQgPDwgQVtpXVtqXSA8PCAiXHQiOwoJCQljb3V0IDw8IGVuZGw7Cgl9CglyZXR1cm4gMDsKfQ==