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

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

class C:
    def __init__(self, txt: str):
        self.v: C = None
        self.r: B = None
        self.t: C = None
        self.txt = txt

e = A("e")
d = B("d")
l = C("l")
k = C("k")

e.r = l
e.w = d
e.o = d
d.q = e
d.t = k
d.y = l
l.v = k
l.t = k
l.r = d
k.v = l
k.t = l
k.r = d
assert d.y.t.v.txt == "
class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.w: B = None
        self.o: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: C = None
        self.r: B = None
        self.t: C = None
        self.txt = txt

e = A("e")
d = B("d")
l = C("l")
k = C("k")

e.r = l
e.w = d
e.o = d
d.q = e
d.t = k
d.y = l
l.v = k
l.t = k
l.r = d
k.v = l
k.t = l
k.r = d
assert d.y.t.v.txt == "l"