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

class B:
    def __init__(self, txt: str):
        self.x: H = None
        self.t: E = None
        self.w: A = None
        self.r: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: D = None
        self.o: H = None
        self.p: F = None
        self.z: A = None
        self.r: B = None
        self.w: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: F = None
        self.y: A = None
        self.q: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: G = None
        self.w: D = None
        self.v: D = None
        self.s: B = None
        self.t: C = None
        self.q: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: F = None
        self.x: B = None
        self.u: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: E = None
        self.w: E = None
        self.v: F = None
        self.u: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.x: H = None
        self.t: E = None
        self.w: A = None
        self.r: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: D = None
        self.o: H = None
        self.p: F = None
        self.z: A = None
        self.r: B = None
        self.w: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: F = None
        self.y: A = None
        self.q: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: G = None
        self.w: D = None
        self.v: D = None
        self.s: B = None
        self.t: C = None
        self.q: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: F = None
        self.x: B = None
        self.u: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: E = None
        self.w: E = None
        self.v: F = None
        self.u: B = None
        self.txt = txt

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

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