#include <bits/stdc++.h>
using namespace std;
const int Mn = 100000 + 10;
int n, m, deg[Mn];
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1, x, y; i <= m; i++) scanf("%d%d", &x, &y), deg[x]++, deg[y]++;
  if (n == m) {
    for (int i = 1; i <= n; i++)
      if (deg[i] != 2) {
        puts("unknown topology");
        return 0;
      }
    puts("ring topology");
  } else if (n == m + 1) {
    int cnt1(0), cnt2(0), cntn(0);
    for (int i = 1; i <= n; i++) {
      if (deg[i] == n - 1) cntn++;
      if (deg[i] > 1) cnt1++;
      if (deg[i] > 2) cnt2++;
    }
    if (cnt2 == 0)
      puts("bus topology");
    else if (cntn == 1 && cnt1 == 1)
      puts("star topology");
    else
      puts("unknown topology");
  } else
    puts("unknown topology");
  return 0;
}
