class A:
    def __init__(self, txt: str):
        self.p: G = None
        self.v: H = None
        self.w: E = None
        self.z: E = None
        self.y: I = None
        self.s: D = None
        self.r: H = None
        self.q: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: F = None
        self.o: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: B = None
        self.o: A = None
        self.v: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.p: G = None
        self.v: A = None
        self.z: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.w: B = None
        self.x: A = None
        self.s: A = None
        self.o: A = None
        self.y: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: I = None
        self.v: E = None
        self.u: B = None
        self.w: H = None
        self.p: I = None
        self.o: F = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: F = None
        self.o: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: B = None
        self.o: A = None
        self.v: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.p: G = None
        self.v: A = None
        self.z: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.w: B = None
        self.x: A = None
        self.s: A = None
        self.o: A = None
        self.y: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: I = None
        self.v: E = None
        self.u: B = None
        self.w: H = None
        self.p: I = None
        self.o: F = None
        self.txt = txt

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

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

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

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