//Source: JadArab
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
vector<int> deg(n+1, 0);
for (int i = 0; i < m; ++i) {
int x, y;
cin >> x >> y;
deg[x]++, deg[y]++;
}
int d1 = 0, d2 = 0, dn = 0;
for (int i = 1; i <= n; ++i) {
if (deg[i] == 1) d1++;
else if (deg[i] == 2) d2++;
else if (deg[i] == n-1) dn++;
}
if (m == n - 1 && d1 == 2 && d2 == n - 2) cout << "bus topology";
else if (m == n && d2 == n) cout << "ring topology";
else if (m == n - 1 && dn == 1 && d1 == n - 1) cout << "star topology";
else cout << "unknown topology";
return 0;
}
Ly9Tb3VyY2U6IEphZEFyYWIKCiNpbmNsdWRlIDxiaXRzL3N0ZGMrKy5oPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSB7CiAgICBpbnQgbiwgbTsKICAgIGNpbiA+PiBuID4+IG07CiAgICB2ZWN0b3I8aW50PiBkZWcobisxLCAwKTsKCiAgICBmb3IgKGludCBpID0gMDsgaSA8IG07ICsraSkgewogICAgICAgIGludCB4LCB5OwogICAgICAgIGNpbiA+PiB4ID4+IHk7CiAgICAgICAgZGVnW3hdKyssIGRlZ1t5XSsrOwogICAgfQoKICAgIGludCBkMSA9IDAsIGQyID0gMCwgZG4gPSAwOwogICAgZm9yIChpbnQgaSA9IDE7IGkgPD0gbjsgKytpKSB7CiAgICAgICAgaWYgKGRlZ1tpXSA9PSAxKSBkMSsrOwogICAgICAgIGVsc2UgaWYgKGRlZ1tpXSA9PSAyKSBkMisrOwogICAgICAgIGVsc2UgaWYgKGRlZ1tpXSA9PSBuLTEpIGRuKys7CiAgICB9CgogICAgaWYgKG0gPT0gbiAtIDEgJiYgZDEgPT0gMiAmJiBkMiA9PSBuIC0gMikgY291dCA8PCAiYnVzIHRvcG9sb2d5IjsKICAgIGVsc2UgaWYgKG0gPT0gbiAmJiBkMiA9PSBuKSBjb3V0IDw8ICJyaW5nIHRvcG9sb2d5IjsKICAgIGVsc2UgaWYgKG0gPT0gbiAtIDEgJiYgZG4gPT0gMSAmJiBkMSA9PSBuIC0gMSkgY291dCA8PCAic3RhciB0b3BvbG9neSI7CiAgICBlbHNlIGNvdXQgPDwgInVua25vd24gdG9wb2xvZ3kiOwoKICAgIHJldHVybiAwOwp9