class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.w: C = None
        self.y: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: A = None
        self.s: C = None
        self.o: B = None
        self.txt = txt

l = A("l")
k = B("k")
c = C("c")
n = A("n")
e = C("e")
a = B("a")

l.r = c
k.z = c
k.w = c
k.y = n
c.t = l
c.s = e
c.o = a
n.r = e
e.t = n
e.s = c
e.o = k
a.z = e
a.w = e
a.y = l
assert k.y.r.t.txt == "
class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.w: C = None
        self.y: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: A = None
        self.s: C = None
        self.o: B = None
        self.txt = txt

l = A("l")
k = B("k")
c = C("c")
n = A("n")
e = C("e")
a = B("a")

l.r = c
k.z = c
k.w = c
k.y = n
c.t = l
c.s = e
c.o = a
n.r = e
e.t = n
e.s = c
e.o = k
a.z = e
a.w = e
a.y = l
assert k.y.r.t.txt == "n"