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

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

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

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

e = A("e")
b = B("b")
k = C("k")
c = D("c")

e.t = c
e.r = c
e.v = c
e.x = b
b.x = k
b.u = k
k.p = e
k.q = c
k.u = c
c.s = k
c.t = k
assert c.s.p.x.txt == "
class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.x: B = None
        self.r: D = None
        self.v: D = None
        self.txt = txt

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

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

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

e = A("e")
b = B("b")
k = C("k")
c = D("c")

e.t = c
e.r = c
e.v = c
e.x = b
b.x = k
b.u = k
k.p = e
k.q = c
k.u = c
c.s = k
c.t = k
assert c.s.p.x.txt == "b"