class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.p: F = None
        self.x: B = None
        self.y: G = None
        self.t: E = None
        self.q: G = None
        self.txt = txt

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

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

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

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

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

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

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

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

a = A("a")
f = B("f")
n = C("n")
e = D("e")
m = E("m")
g = F("g")
b = G("b")
d = H("d")
k = I("k")
l = E("l")

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

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

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

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

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

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

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

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

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

a = A("a")
f = B("f")
n = C("n")
e = D("e")
m = E("m")
g = F("g")
b = G("b")
d = H("d")
k = I("k")
l = E("l")

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