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

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: I = None
        self.z: I = None
        self.q: G = None
        self.w: I = None
        self.o: B = None
        self.p: B = None
        self.t: D = None
        self.u: B = None
        self.r: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: I = None
        self.txt = txt

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

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

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

l = A("l")
d = B("d")
m = C("m")
j = D("j")
g = E("g")
i = F("i")
c = G("c")
k = H("k")
b = I("b")

l.p = m
l.r = g
d.o = b
d.z = b
d.y = l
d.s = l
d.v = j
d.r = j
d.p = k
m.w = j
j.x = k
j.z = b
j.t = m
g.x = b
g.z = b
g.w = b
g.r = b
g.q = c
g.o = d
g.p = d
g.u = d
g.t = j
i.u = b
c.o = g
k.v = j
k.t = i
b.x = g
b.q = g
b.o = d
assert m.w.x.v.z.o.txt == "
class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.r: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: I = None
        self.z: I = None
        self.q: G = None
        self.w: I = None
        self.o: B = None
        self.p: B = None
        self.t: D = None
        self.u: B = None
        self.r: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: I = None
        self.txt = txt

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

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

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

l = A("l")
d = B("d")
m = C("m")
j = D("j")
g = E("g")
i = F("i")
c = G("c")
k = H("k")
b = I("b")

l.p = m
l.r = g
d.o = b
d.z = b
d.y = l
d.s = l
d.v = j
d.r = j
d.p = k
m.w = j
j.x = k
j.z = b
j.t = m
g.x = b
g.z = b
g.w = b
g.r = b
g.q = c
g.o = d
g.p = d
g.u = d
g.t = j
i.u = b
c.o = g
k.v = j
k.t = i
b.x = g
b.q = g
b.o = d
assert m.w.x.v.z.o.txt == "d"