#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, i, a[100001] = {0}, x, y, j, k;
  cin >> n >> m;
  for (i = 1; i <= m; i++) {
    cin >> x >> y;
    a[x]++;
    a[y]++;
  }
  sort(a, a + n + 1);
  if (a[1] == 1 && a[2] == 1) {
    for (i = 3; i <= n; i++)
      if (a[i] != 2) break;
    if (i == n + 1)
      cout << "bus topology\n";
    else if (a[n] == m) {
      for (j = 3; j < n; j++)
        if (a[j] != 1) break;
      if (j == n)
        cout << "star topology\n";
      else
        cout << "unknown topology\n";
    } else
      cout << "unknown topology\n";
  } else {
    for (k = 1; k <= n; k++)
      if (a[k] != 2) break;
    if (k == n + 1)
      cout << "ring topology\n";
    else
      cout << "unknown topology\n";
  }
  return 0;
}
