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

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

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.o: E = None
        self.r: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: F = None
        self.s: D = None
        self.u: E = None
        self.v: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: C = None
        self.r: E = None
        self.t: A = None
        self.p: B = None
        self.q: E = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.o: E = None
        self.r: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: F = None
        self.s: D = None
        self.u: E = None
        self.v: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: C = None
        self.r: E = None
        self.t: A = None
        self.p: B = None
        self.q: E = None
        self.txt = txt

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

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