class A:
    def __init__(self, txt: str):
        self.s: G = None
        self.x: G = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.x: I = None
        self.t: D = None
        self.z: G = None
        self.y: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: E = None
        self.t: E = None
        self.z: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: E = None
        self.s: I = None
        self.txt = txt

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

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.x: I = None
        self.t: D = None
        self.z: G = None
        self.y: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: E = None
        self.t: E = None
        self.z: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: E = None
        self.s: I = None
        self.txt = txt

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

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

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

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