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

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

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

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

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

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

a.q = f
k.z = a
c.u = j
c.p = j
c.s = j
c.t = a
c.x = h
h.q = j
h.t = k
h.u = i
h.z = a
h.x = d
j.u = a
j.y = k
j.q = k
j.p = h
i.q = d
i.x = d
i.t = k
i.u = h
i.z = a
f.u = j
f.p = j
f.s = j
f.t = a
f.x = h
d.u = a
d.y = k
d.q = k
d.p = h
assert d.u.q.x.t.z.q.p.txt == "
class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

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

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

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

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

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

a.q = f
k.z = a
c.u = j
c.p = j
c.s = j
c.t = a
c.x = h
h.q = j
h.t = k
h.u = i
h.z = a
h.x = d
j.u = a
j.y = k
j.q = k
j.p = h
i.q = d
i.x = d
i.t = k
i.u = h
i.z = a
f.u = j
f.p = j
f.s = j
f.t = a
f.x = h
d.u = a
d.y = k
d.q = k
d.p = h
assert d.u.q.x.t.z.q.p.txt == "j"