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