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

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

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

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

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

c = A("c")
b = B("b")
d = C("d")
i = D("i")
f = E("f")
j = D("j")
h = D("h")
a = D("a")

c.x = h
b.w = c
b.s = d
b.z = d
d.v = a
d.q = i
i.x = b
i.u = b
i.q = b
f.t = b
f.u = c
f.s = j
j.x = b
j.u = b
j.q = b
h.x = b
h.u = b
h.q = b
a.x = b
a.u = b
a.q = b
assert c.x.u.w.x.u.w.x.q.txt == "
class A:
    def __init__(self, txt: str):
        self.x: D = None
        self.txt = txt

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

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

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

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

c = A("c")
b = B("b")
d = C("d")
i = D("i")
f = E("f")
j = D("j")
h = D("h")
a = D("a")

c.x = h
b.w = c
b.s = d
b.z = d
d.v = a
d.q = i
i.x = b
i.u = b
i.q = b
f.t = b
f.u = c
f.s = j
j.x = b
j.u = b
j.q = b
h.x = b
h.u = b
h.q = b
a.x = b
a.u = b
a.q = b
assert c.x.u.w.x.u.w.x.q.txt == "b"