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

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

class C:
    def __init__(self, txt: str):
        self.p: G = None
        self.s: E = None
        self.q: H = None
        self.t: I = None
        self.o: A = None
        self.x: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: E = None
        self.s: A = None
        self.o: B = None
        self.x: H = None
        self.p: G = None
        self.q: E = None
        self.t: H = None
        self.y: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.s: C = None
        self.y: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: F = None
        self.w: F = None
        self.z: I = None
        self.r: F = None
        self.o: I = None
        self.s: D = None
        self.v: B = None
        self.p: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: D = None
        self.z: H = None
        self.o: G = None
        self.y: C = None
        self.t: B = None
        self.x: D = None
        self.r: E = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: G = None
        self.s: E = None
        self.q: H = None
        self.t: I = None
        self.o: A = None
        self.x: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: E = None
        self.s: A = None
        self.o: B = None
        self.x: H = None
        self.p: G = None
        self.q: E = None
        self.t: H = None
        self.y: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.s: C = None
        self.y: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: F = None
        self.w: F = None
        self.z: I = None
        self.r: F = None
        self.o: I = None
        self.s: D = None
        self.v: B = None
        self.p: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: D = None
        self.z: H = None
        self.o: G = None
        self.y: C = None
        self.t: B = None
        self.x: D = None
        self.r: E = None
        self.txt = txt

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

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