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

class B:
    def __init__(self, txt: str):
        self.s: I = None
        self.x: D = None
        self.t: I = None
        self.o: G = None
        self.y: E = None
        self.u: I = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: B = None
        self.q: A = None
        self.v: B = None
        self.u: C = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.o: F = None
        self.w: C = None
        self.x: D = None
        self.s: G = None
        self.z: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.s: I = None
        self.x: D = None
        self.t: I = None
        self.o: G = None
        self.y: E = None
        self.u: I = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: B = None
        self.q: A = None
        self.v: B = None
        self.u: C = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.o: F = None
        self.w: C = None
        self.x: D = None
        self.s: G = None
        self.z: C = None
        self.txt = txt

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

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