class A:
    def __init__(self, txt: str):
        self.x: J = None
        self.r: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: D = None
        self.x: J = None
        self.u: D = None
        self.q: G = None
        self.p: F = None
        self.y: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.v: B = None
        self.r: J = None
        self.p: E = None
        self.x: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: F = None
        self.q: H = None
        self.x: D = None
        self.t: D = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.w: A = None
        self.o: E = None
        self.q: B = None
        self.r: H = None
        self.x: E = None
        self.u: E = None
        self.t: G = None
        self.y: E = None
        self.p: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.p: H = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.t: D = None
        self.x: J = None
        self.u: D = None
        self.q: G = None
        self.p: F = None
        self.y: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.v: B = None
        self.r: J = None
        self.p: E = None
        self.x: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: F = None
        self.q: H = None
        self.x: D = None
        self.t: D = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.w: A = None
        self.o: E = None
        self.q: B = None
        self.r: H = None
        self.x: E = None
        self.u: E = None
        self.t: G = None
        self.y: E = None
        self.p: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.p: H = None
        self.txt = txt

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

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