public String isBounded(String[] graph)
	{
		int[] c = new int[100];
		int n = graph.length;
		for (int i = 0; i < n; i++) {
			int f = -1;
			Queue<Integer> q = new LinkedList<>();
			q.add(i);

			while (!q.isEmpty()) {
				int now = q.poll();
				c[now] = 1;
				if (now == i) {
					f++;
					c[now] = 0;
					if (f >= 2)
						return "Unbounded";
				}
				for (int j = 0; j < n; j++) {
					if (c[j] == 0 && graph[now].charAt(j) == 'Y') {
						q.add(j);
					}
				}
			}
		}
		return "Bounded";

	}