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

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: G = None
        self.v: B = None
        self.r: F = None
        self.x: B = None
        self.o: G = None
        self.w: I = None
        self.t: H = None
        self.s: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: I = None
        self.t: G = None
        self.x: G = None
        self.p: G = None
        self.r: F = None
        self.y: C = None
        self.q: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: I = None
        self.q: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.r: E = None
        self.o: I = None
        self.p: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: D = None
        self.v: H = None
        self.p: B = None
        self.w: F = None
        self.r: B = None
        self.x: G = None
        self.u: H = None
        self.y: H = None
        self.s: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: G = None
        self.v: B = None
        self.r: F = None
        self.x: B = None
        self.o: G = None
        self.w: I = None
        self.t: H = None
        self.s: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: I = None
        self.t: G = None
        self.x: G = None
        self.p: G = None
        self.r: F = None
        self.y: C = None
        self.q: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: I = None
        self.q: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.r: E = None
        self.o: I = None
        self.p: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: D = None
        self.v: H = None
        self.p: B = None
        self.w: F = None
        self.r: B = None
        self.x: G = None
        self.u: H = None
        self.y: H = None
        self.s: B = None
        self.txt = txt

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

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