#include <bits/stdc++.h>
using namespace std;
int in[100010], cnt[100010 * 2];
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= m; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    in[y]++;
    in[x]++;
  }
  if (n < m || m < n - 1) {
    puts("unknown topology");
    return 0;
  }
  for (int i = 1; i <= n; i++) cnt[in[i]]++;
  if (n == m) {
    if (cnt[2] == n)
      puts("ring topology");
    else
      puts("unknown topology");
  } else {
    if (cnt[1] == 2 && cnt[2] == n - 2) {
      puts("bus topology");
    } else if (cnt[1] == n - 1 && cnt[n - 1] == 1)
      puts("star topology");
    else
      puts("unknown topology");
  }
  return 0;
}
