class A:
    def __init__(self, txt: str):
        self.r: F = None
        self.z: G = None
        self.x: D = None
        self.o: F = None
        self.p: I = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: H = None
        self.z: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.u: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.x: H = None
        self.z: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.u: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

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

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

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

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

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

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