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

class B:
    def __init__(self, txt: str):
        self.o: F = None
        self.u: G = None
        self.q: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: H = None
        self.o: F = None
        self.q: I = None
        self.r: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: A = None
        self.y: D = None
        self.z: A = None
        self.v: G = None
        self.w: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: A = None
        self.w: C = None
        self.z: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: B = None
        self.y: D = None
        self.v: C = None
        self.r: I = None
        self.w: C = None
        self.p: B = None
        self.x: C = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.o: F = None
        self.u: G = None
        self.q: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: H = None
        self.o: F = None
        self.q: I = None
        self.r: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: A = None
        self.y: D = None
        self.z: A = None
        self.v: G = None
        self.w: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: A = None
        self.w: C = None
        self.z: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: B = None
        self.y: D = None
        self.v: C = None
        self.r: I = None
        self.w: C = None
        self.p: B = None
        self.x: C = None
        self.txt = txt

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

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

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