using System;
class GFG {
static int checkConnected(int[, ] graph, int n)
{
bool strongly = true;
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
if (graph[i, j] != graph[j, i]) {
strongly = false;
break;
}
}
if (!strongly) {
break;
}
}
if (strongly) {
Console.Write("Strongly Connected");
return 0;
}
bool uppertri = true;
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
if (i > j && graph[i, j] == 0) {
uppertri = false;
break;
}
}
if (!uppertri) {
break;
}
}
if (uppertri) {
Console.Write("Unilaterally Connected");
return 0;
}
bool lowertri = true;
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
if (i < j && graph[i, j] == 0) {
lowertri = false;
break;
}
}
if (!lowertri) {
break;
}
}
if (lowertri) {
Console.Write("Unilaterally Connected");
return 0;
}
else {
Console.Write("Weakly Connected");
}
return 0;
}
public static void Main(String[] args)
{
int n = 3;
int[, ] graph
= { { 0, 1, 1 }, { 0, 0, 1 }, { 0, 0, 0 } };
checkConnected(graph, n);
}
}