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

class B:
    def __init__(self, txt: str):
        self.r: I = None
        self.p: H = None
        self.x: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: E = None
        self.t: A = None
        self.w: I = None
        self.v: B = None
        self.y: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: H = None
        self.z: G = None
        self.q: D = None
        self.r: C = None
        self.w: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: C = None
        self.u: I = None
        self.t: H = None
        self.o: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: F = None
        self.w: E = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: I = None
        self.p: H = None
        self.x: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: E = None
        self.t: A = None
        self.w: I = None
        self.v: B = None
        self.y: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: H = None
        self.z: G = None
        self.q: D = None
        self.r: C = None
        self.w: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: C = None
        self.u: I = None
        self.t: H = None
        self.o: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: F = None
        self.w: E = None
        self.txt = txt

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

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

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