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

class B:
    def __init__(self, txt: str):
        self.x: H = None
        self.v: H = None
        self.u: F = None
        self.o: A = None
        self.t: A = None
        self.s: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: I = None
        self.y: B = None
        self.r: H = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.v: B = None
        self.x: H = None
        self.r: C = None
        self.p: C = None
        self.w: I = None
        self.s: E = None
        self.z: F = None
        self.t: B = None
        self.u: C = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.x: H = None
        self.v: H = None
        self.u: F = None
        self.o: A = None
        self.t: A = None
        self.s: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: I = None
        self.y: B = None
        self.r: H = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.v: B = None
        self.x: H = None
        self.r: C = None
        self.p: C = None
        self.w: I = None
        self.s: E = None
        self.z: F = None
        self.t: B = None
        self.u: C = None
        self.txt = txt

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

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

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

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