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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.r: E = None
        self.x: F = None
        self.t: F = None
        self.q: E = None
        self.u: F = None
        self.y: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: F = None
        self.q: A = None
        self.w: D = None
        self.v: H = None
        self.txt = txt

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

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.r: E = None
        self.x: F = None
        self.t: F = None
        self.q: E = None
        self.u: F = None
        self.y: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: F = None
        self.q: A = None
        self.w: D = None
        self.v: H = None
        self.txt = txt

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

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