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

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

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.p: E = None
        self.s: D = None
        self.q: E = None
        self.z: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: B = None
        self.q: C = None
        self.v: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: E = None
        self.p: H = None
        self.w: G = None
        self.s: C = None
        self.t: A = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.y: B = None
        self.t: F = None
        self.s: H = None
        self.v: D = None
        self.o: F = None
        self.p: C = None
        self.r: B = None
        self.q: C = None
        self.txt = txt

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

a.o = c
a.v = e
f.s = h
e.r = a
e.p = h
e.q = h
e.s = l
e.z = c
l.w = f
l.q = e
l.v = a
h.w = a
c.y = h
c.p = g
c.w = i
c.s = e
c.t = a
i.w = g
g.s = e
g.x = e
d.y = f
d.r = f
d.t = c
d.o = c
d.s = g
d.v = l
d.p = e
d.q = e
assert h.w.v.p.w.v.s.txt == "
class A:
    def __init__(self, txt: str):
        self.o: F = None
        self.v: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.p: E = None
        self.s: D = None
        self.q: E = None
        self.z: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: B = None
        self.q: C = None
        self.v: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: E = None
        self.p: H = None
        self.w: G = None
        self.s: C = None
        self.t: A = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.y: B = None
        self.t: F = None
        self.s: H = None
        self.v: D = None
        self.o: F = None
        self.p: C = None
        self.r: B = None
        self.q: C = None
        self.txt = txt

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

a.o = c
a.v = e
f.s = h
e.r = a
e.p = h
e.q = h
e.s = l
e.z = c
l.w = f
l.q = e
l.v = a
h.w = a
c.y = h
c.p = g
c.w = i
c.s = e
c.t = a
i.w = g
g.s = e
g.x = e
d.y = f
d.r = f
d.t = c
d.o = c
d.s = g
d.v = l
d.p = e
d.q = e
assert h.w.v.p.w.v.s.txt == "l"