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

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

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.s: E = None
        self.q: F = None
        self.z: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: E = None
        self.s: E = None
        self.y: F = None
        self.p: C = None
        self.w: A = None
        self.o: H = None
        self.x: F = None
        self.txt = txt

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

h = A("h")
b = B("b")
e = C("e")
l = D("l")
g = E("g")
m = F("m")
c = G("c")
a = H("a")
j = E("j")
n = B("n")

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

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

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.s: E = None
        self.q: F = None
        self.z: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: E = None
        self.s: E = None
        self.y: F = None
        self.p: C = None
        self.w: A = None
        self.o: H = None
        self.x: F = None
        self.txt = txt

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

h = A("h")
b = B("b")
e = C("e")
l = D("l")
g = E("g")
m = F("m")
c = G("c")
a = H("a")
j = E("j")
n = B("n")

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