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

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

class C:
    def __init__(self, txt: str):
        self.w: G = None
        self.t: G = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.y: F = None
        self.o: F = None
        self.z: B = None
        self.t: B = None
        self.p: D = None
        self.s: H = None
        self.u: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: D = None
        self.s: F = None
        self.txt = txt

a = A("a")
c = B("c")
e = C("e")
h = D("h")
d = E("d")
j = F("j")
i = G("i")
n = H("n")
l = D("l")

a.v = c
a.q = h
c.w = e
c.y = e
c.q = h
c.s = h
e.w = i
e.t = i
h.w = d
h.p = d
h.o = d
h.z = i
d.q = c
d.v = h
j.x = a
i.y = j
i.o = j
i.u = j
i.z = c
i.t = c
i.p = h
i.s = n
n.r = h
n.s = j
l.w = d
l.p = d
l.o = d
l.z = i
assert a.q.z.s.r.p.v.o.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.q: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: G = None
        self.t: G = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.y: F = None
        self.o: F = None
        self.z: B = None
        self.t: B = None
        self.p: D = None
        self.s: H = None
        self.u: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: D = None
        self.s: F = None
        self.txt = txt

a = A("a")
c = B("c")
e = C("e")
h = D("h")
d = E("d")
j = F("j")
i = G("i")
n = H("n")
l = D("l")

a.v = c
a.q = h
c.w = e
c.y = e
c.q = h
c.s = h
e.w = i
e.t = i
h.w = d
h.p = d
h.o = d
h.z = i
d.q = c
d.v = h
j.x = a
i.y = j
i.o = j
i.u = j
i.z = c
i.t = c
i.p = h
i.s = n
n.r = h
n.s = j
l.w = d
l.p = d
l.o = d
l.z = i
assert a.q.z.s.r.p.v.o.txt == "d"