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

class B:
    def __init__(self, txt: str):
        self.u: E = None
        self.t: I = None
        self.z: J = None
        self.p: I = None
        self.s: A = None
        self.r: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: A = None
        self.o: I = None
        self.s: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.w: B = None
        self.p: G = None
        self.t: J = None
        self.v: H = None
        self.r: A = None
        self.u: H = None
        self.x: B = None
        self.o: H = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.w: D = None
        self.y: H = None
        self.v: J = None
        self.x: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.r: A = None
        self.x: B = None
        self.v: C = None
        self.z: G = None
        self.w: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.u: E = None
        self.t: I = None
        self.z: J = None
        self.p: I = None
        self.s: A = None
        self.r: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: A = None
        self.o: I = None
        self.s: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.w: B = None
        self.p: G = None
        self.t: J = None
        self.v: H = None
        self.r: A = None
        self.u: H = None
        self.x: B = None
        self.o: H = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.w: D = None
        self.y: H = None
        self.v: J = None
        self.x: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.r: A = None
        self.x: B = None
        self.v: C = None
        self.z: G = None
        self.w: B = None
        self.txt = txt

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

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