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

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

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

class D:
    def __init__(self, txt: str):
        self.v: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: E = None
        self.p: D = None
        self.z: C = None
        self.x: A = None
        self.v: B = None
        self.s: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: B = None
        self.v: I = None
        self.u: G = None
        self.x: I = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.q: G = None
        self.u: C = None
        self.v: F = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.v: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: E = None
        self.p: D = None
        self.z: C = None
        self.x: A = None
        self.v: B = None
        self.s: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: B = None
        self.v: I = None
        self.u: G = None
        self.x: I = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.q: G = None
        self.u: C = None
        self.v: F = None
        self.txt = txt

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

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

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