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

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

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

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

b = A("b")
i = B("i")
j = C("j")
c = D("c")
k = D("k")
n = A("n")
l = C("l")
f = B("f")

b.t = l
b.x = n
b.q = j
b.s = i
i.u = c
j.w = c
j.p = c
j.z = l
c.w = k
c.q = j
c.v = l
c.s = f
k.w = c
k.q = j
k.v = j
k.s = i
n.t = j
n.q = j
n.x = b
n.s = f
l.w = c
l.z = j
l.p = k
f.u = k
assert n.x.s.u.w.v.z.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.x: A = None
        self.q: C = None
        self.s: B = None
        self.txt = txt

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

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

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

b = A("b")
i = B("i")
j = C("j")
c = D("c")
k = D("k")
n = A("n")
l = C("l")
f = B("f")

b.t = l
b.x = n
b.q = j
b.s = i
i.u = c
j.w = c
j.p = c
j.z = l
c.w = k
c.q = j
c.v = l
c.s = f
k.w = c
k.q = j
k.v = j
k.s = i
n.t = j
n.q = j
n.x = b
n.s = f
l.w = c
l.z = j
l.p = k
f.u = k
assert n.x.s.u.w.v.z.txt == "l"