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

class B:
    def __init__(self, txt: str):
        self.z: A = None
        self.x: E = None
        self.s: C = None
        self.t: J = None
        self.w: G = None
        self.p: A = None
        self.q: C = None
        self.o: G = None
        self.v: I = None
        self.y: F = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.x: J = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: D = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.t: D = None
        self.p: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: A = None
        self.x: E = None
        self.s: C = None
        self.t: J = None
        self.w: G = None
        self.p: A = None
        self.q: C = None
        self.o: G = None
        self.v: I = None
        self.y: F = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.x: J = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: D = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.t: D = None
        self.p: C = None
        self.txt = txt

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

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