class A:
    def __init__(self, txt: str):
        self.z: J = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.q: J = None
        self.z: A = None
        self.u: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: G = None
        self.p: I = None
        self.o: D = None
        self.y: J = None
        self.w: J = None
        self.r: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.y: A = None
        self.p: G = None
        self.v: C = None
        self.z: I = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: F = None
        self.y: G = None
        self.s: F = None
        self.r: D = None
        self.u: J = None
        self.p: A = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.t: I = None
        self.u: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.q: J = None
        self.z: A = None
        self.u: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: G = None
        self.p: I = None
        self.o: D = None
        self.y: J = None
        self.w: J = None
        self.r: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.y: A = None
        self.p: G = None
        self.v: C = None
        self.z: I = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: F = None
        self.y: G = None
        self.s: F = None
        self.r: D = None
        self.u: J = None
        self.p: A = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.t: I = None
        self.u: G = None
        self.txt = txt

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

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