class A:
    def __init__(self, txt: str):
        self.x: D = None
        self.w: E = None
        self.o: G = None
        self.p: C = None
        self.v: B = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.v: A = None
        self.x: B = None
        self.w: G = None
        self.o: E = None
        self.txt = txt

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

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.v: A = None
        self.x: B = None
        self.w: G = None
        self.o: E = None
        self.txt = txt

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

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