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

class B:
    def __init__(self, txt: str):
        self.u: C = None
        self.z: D = None
        self.y: C = None
        self.q: D = None
        self.r: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.z: D = None
        self.x: H = None
        self.t: E = None
        self.txt = txt

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

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.u: C = None
        self.z: D = None
        self.y: C = None
        self.q: D = None
        self.r: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.z: D = None
        self.x: H = None
        self.t: E = None
        self.txt = txt

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

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

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

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

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

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

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