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

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

class C:
    def __init__(self, txt: str):
        self.q: G = None
        self.o: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: I = None
        self.x: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: B = None
        self.s: C = None
        self.r: B = None
        self.p: D = None
        self.o: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: H = None
        self.o: H = None
        self.r: B = None
        self.z: A = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.q: G = None
        self.o: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: I = None
        self.x: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: B = None
        self.s: C = None
        self.r: B = None
        self.p: D = None
        self.o: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: H = None
        self.o: H = None
        self.r: B = None
        self.z: A = None
        self.txt = txt

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

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

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

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