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

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

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

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

c = A("c")
b = B("b")
h = C("h")
k = D("k")
f = D("f")
d = D("d")
l = C("l")
e = B("e")

c.t = h
c.z = l
c.r = d
c.w = b
b.x = e
h.z = l
h.w = e
h.v = k
h.q = d
k.q = d
k.v = f
k.u = e
f.q = k
f.v = k
f.u = b
d.q = k
d.v = f
d.u = b
l.z = h
l.w = b
l.v = d
l.q = k
e.x = b
assert l.z.z.w.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.z: C = None
        self.r: D = None
        self.w: B = None
        self.txt = txt

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

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

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

c = A("c")
b = B("b")
h = C("h")
k = D("k")
f = D("f")
d = D("d")
l = C("l")
e = B("e")

c.t = h
c.z = l
c.r = d
c.w = b
b.x = e
h.z = l
h.w = e
h.v = k
h.q = d
k.q = d
k.v = f
k.u = e
f.q = k
f.v = k
f.u = b
d.q = k
d.v = f
d.u = b
l.z = h
l.w = b
l.v = d
l.q = k
e.x = b
assert l.z.z.w.txt == "b"