from collections import defaultdict
n, m = map(int, input().split())
adjacency_list = defaultdict(list)
for _ in range(m):
x, y = map(int, input().split())
adjacency_list[x].append(y)
adjacency_list[y].append(x)
degree_count = defaultdict(int)
for node in adjacency_list:
degree_count[len(adjacency_list[node])] += 1
if degree_count[2] == n - 2 and degree_count[1] == 2 and degree_count[3] == 0:
print("bus topology")
elif degree_count[2] == n:
print("ring topology")
elif degree_count[n - 1] == 1 and degree_count[1] == n - 1:
print("star topology")
else:
print("unknown topology")
from collections import defaultdict
n, m = map(int, input().split())
adjacency_list = defaultdict(int)
for _ in range(m):
x, y = map(int, input().split())
adjacency_list[x] += 1
adjacency_list[y] += 1
degree_count = defaultdict(int)
for node in adjacency_list:
degree_count[adjacency_list[node]] += 1
if degree_count[2] == n - 2 and degree_count[1] == 2 and degree_count[3] == 0:
print("bus topology")
elif degree_count[2] == n:
print("ring topology")
elif degree_count[n - 1] == 1 and degree_count[1] == n - 1:
print("star topology")
else:
print("unknown topology")