#include <bits/stdc++.h>
using namespace std;
long long int getSum(long long int n) {
  long long int sum;
  for (sum = 0; n > 0; sum += n % 10, n /= 10)
    ;
  return sum;
}
void yes() { cout << "YES" << endl; }
void no() { cout << "NO" << endl; }
bool isPrime(long long int n) {
  if (n <= 1) return false;
  if (n <= 3) return true;
  if (n % 2 == 0 || n % 3 == 0) return false;
  for (long long int i = 5; i * i <= n; i = i + 6)
    if (n % i == 0 || n % (i + 2) == 0) return false;
  return true;
}
vector<long long int> SieveOfEratosthenes(long long int n) {
  vector<long long int> primes;
  bool prime[n + 1];
  memset(prime, true, sizeof(prime));
  for (long long int p = 2; p * p <= n; p++) {
    if (prime[p] == true) {
      for (long long int i = p * p; i <= n; i += p) prime[i] = false;
    }
  }
  for (long long int p = 2; p <= n; p++)
    if (prime[p]) primes.push_back(p);
  return primes;
}
long long int gcd(long long int a, long long int b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
long long int lcm(long long int a, long long int b) {
  long long int G = gcd(a, b);
  long long int k = (a * b) / G;
  return k;
}
bool cmp(pair<long long int, long long int> &a,
         pair<long long int, long long int> &b) {
  return a.second > b.second;
}
float round_up(float value, int decimal_places) {
  const float multiplier = pow(10.0, decimal_places);
  float v = value * multiplier;
  float u = value * multiplier * 10;
  int k = floor(u);
  if (int(floor(v)) % 2 == 0) {
    if (k % 5 == 0 && k % 10 != 0) {
      return floor(v) / multiplier;
    }
  }
  return ceil(value * multiplier) / multiplier;
}
bool palindrome(const string &s) {
  int n = s.length();
  for (int i = 0; i < n; i++) {
    if (s[i] != s[n - i - 1]) return false;
  }
  return true;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  vector<int> arr[n + 1];
  for (long long int i = 0; i < m; i++) {
    int x, y;
    cin >> x >> y;
    arr[x].push_back(y);
    arr[y].push_back(x);
  }
  int one = 0, two = 0, end = 0;
  for (int i = 1; i < n + 1; i++) {
    if (arr[i].size() == 1)
      one++;
    else if (arr[i].size() == 2)
      two++;
    else if (arr[i].size() == n - 1)
      end++;
  }
  if (one == 2 && two == n - 2)
    cout << "bus topology" << endl;
  else if (two == n && one == 0 && end == 0)
    cout << "ring topology" << endl;
  else if (one == n - 1 && end == 1)
    cout << "star topology" << endl;
  else
    cout << "unknown topology" << endl;
  return 0;
}
