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

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.v: A = None
        self.s: D = None
        self.z: E = None
        self.w: G = None
        self.u: C = None
        self.o: H = None
        self.p: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.v: G = None
        self.p: H = None
        self.z: A = None
        self.w: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: C = None
        self.r: C = None
        self.x: B = None
        self.p: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: C = None
        self.s: F = None
        self.p: H = None
        self.w: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

l = A("l")
e = B("e")
g = C("g")
c = D("c")
j = E("j")
d = F("d")
f = G("f")
b = H("b")
m = G("m")
k = F("k")

l.z = b
e.y = l
e.v = l
e.s = c
e.z = j
e.p = j
e.w = f
e.u = g
e.o = b
g.y = e
g.w = e
g.v = f
g.p = b
g.z = l
c.p = l
c.v = b
j.y = g
j.r = g
j.x = e
j.p = b
d.u = g
d.s = k
d.p = b
d.w = e
f.w = b
f.p = m
f.o = g
f.r = l
f.z = l
f.q = l
f.x = c
f.y = j
b.u = e
m.w = b
m.p = f
m.o = g
m.r = l
m.z = l
m.q = l
m.x = c
m.y = j
k.u = g
k.s = d
k.p = b
k.w = e
assert m.z.z.u.w.txt == "
class A:
    def __init__(self, txt: str):
        self.z: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.v: A = None
        self.s: D = None
        self.z: E = None
        self.w: G = None
        self.u: C = None
        self.o: H = None
        self.p: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.v: G = None
        self.p: H = None
        self.z: A = None
        self.w: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: C = None
        self.r: C = None
        self.x: B = None
        self.p: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: C = None
        self.s: F = None
        self.p: H = None
        self.w: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

l = A("l")
e = B("e")
g = C("g")
c = D("c")
j = E("j")
d = F("d")
f = G("f")
b = H("b")
m = G("m")
k = F("k")

l.z = b
e.y = l
e.v = l
e.s = c
e.z = j
e.p = j
e.w = f
e.u = g
e.o = b
g.y = e
g.w = e
g.v = f
g.p = b
g.z = l
c.p = l
c.v = b
j.y = g
j.r = g
j.x = e
j.p = b
d.u = g
d.s = k
d.p = b
d.w = e
f.w = b
f.p = m
f.o = g
f.r = l
f.z = l
f.q = l
f.x = c
f.y = j
b.u = e
m.w = b
m.p = f
m.o = g
m.r = l
m.z = l
m.q = l
m.x = c
m.y = j
k.u = g
k.s = d
k.p = b
k.w = e
assert m.z.z.u.w.txt == "f"