#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e5 + 5;
int n, m;
vector<int> G[MAX];
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= m; i++) {
    int a, b;
    scanf("%d%d", &a, &b);
    G[a].push_back(b);
    G[b].push_back(a);
  }
  if (m == n - 1) {
    int flag = 0;
    for (int i = 1; i <= n; i++) {
      if (G[i].size() == n - 1) {
        printf("star topology\n");
        return 0;
      }
      if (G[i].size() > 2) flag = 1;
    }
    if (flag)
      printf("unknown topology\n");
    else
      printf("bus topology\n");
  } else {
    for (int i = 1; i <= n; i++) {
      if (G[i].size() != 2) {
        printf("unknown topology\n");
        return 0;
      }
    }
    printf("ring topology\n");
  }
  return 0;
}
