#include using namespace std; int main(void) { int N; cin >> N; vector> D(N, vector(N)); for(int i = 0; i < N; i++){ for(int j = 0; j < N; j++){ cin >> D[i][j]; } } bool property1 = true; bool property2 = true; bool property3 = true; bool property4 = true; // ① 非退化性 for(int i = 0; i < N; i++){ for(int j = 0; j < N; j++){ if(i == j && D[i][j] != 0) property1 = false; if(i != j && D[i][j] == 0) property1 = false; } } // ② 対称性 for(int i = 0; i < N; i++){ for(int j = 0; j < N; j++){ if(D[i][j] != D[j][i]) property2 = false; } } // ③ 三角不等式 for(int i = 0; i < N; i++){ for(int j = 0; j < N; j++){ for(int k = 0; k < N; k++){ if(D[i][j] > D[i][k] + D[k][j]){ property3 = false; } } } } // ④ 強三角不等式 for(int i = 0; i < N; i++){ for(int j = 0; j < N; j++){ for(int k = 0; k < N; k++){ if(D[i][j] > max(D[i][k], D[k][j])){ property4 = false; } } } } // 判定 if(property1 && property2 && property3){ cout << "Good" << endl; } else { cout << "Not Good" << endl; } if(property1 && property2 && property4){ cout << "Super Good" << endl; } else { cout << "Not Super Good" << endl; } return 0; }