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

class B:
    def __init__(self, txt: str):
        self.w: C = None
        self.q: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: C = None
        self.q: C = None
        self.t: A = None
        self.u: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

a = A("a")
l = B("l")
c = C("c")
f = D("f")
b = C("b")
e = C("e")

a.t = l
l.w = c
l.q = f
c.s = b
c.q = e
c.t = a
c.u = f
f.u = l
b.s = e
b.q = e
b.t = a
b.u = f
e.s = c
e.q = c
e.t = a
e.u = f
assert b.t.t.q.u.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: C = None
        self.q: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: C = None
        self.q: C = None
        self.t: A = None
        self.u: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

a = A("a")
l = B("l")
c = C("c")
f = D("f")
b = C("b")
e = C("e")

a.t = l
l.w = c
l.q = f
c.s = b
c.q = e
c.t = a
c.u = f
f.u = l
b.s = e
b.q = e
b.t = a
b.u = f
e.s = c
e.q = c
e.t = a
e.u = f
assert b.t.t.q.u.txt == "l"