class A:
    def __init__(self, txt: str):
        self.w: H = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: G = None
        self.x: E = None
        self.p: B = None
        self.z: F = None
        self.q: D = None
        self.o: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.w: B = None
        self.o: A = None
        self.u: B = None
        self.p: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: B = None
        self.z: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: E = None
        self.q: B = None
        self.p: B = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: G = None
        self.x: E = None
        self.p: B = None
        self.z: F = None
        self.q: D = None
        self.o: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.w: B = None
        self.o: A = None
        self.u: B = None
        self.p: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: B = None
        self.z: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: E = None
        self.q: B = None
        self.p: B = None
        self.txt = txt

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

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