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

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

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

class D:
    def __init__(self, txt: str):
        self.o: H = None
        self.t: A = None
        self.r: C = None
        self.p: A = None
        self.y: C = None
        self.v: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: F = None
        self.x: G = None
        self.t: H = None
        self.o: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: A = None
        self.z: F = None
        self.t: F = None
        self.v: H = None
        self.q: D = None
        self.y: E = None
        self.x: H = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.o: H = None
        self.t: A = None
        self.r: C = None
        self.p: A = None
        self.y: C = None
        self.v: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: F = None
        self.x: G = None
        self.t: H = None
        self.o: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: A = None
        self.z: F = None
        self.t: F = None
        self.v: H = None
        self.q: D = None
        self.y: E = None
        self.x: H = None
        self.txt = txt

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

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

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