class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.p: B = None
        self.y: J = None
        self.r: J = None
        self.u: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: F = None
        self.o: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.o: A = None
        self.s: D = None
        self.q: G = None
        self.y: J = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: A = None
        self.t: E = None
        self.r: J = None
        self.s: H = None
        self.y: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.w: E = None
        self.s: J = None
        self.q: G = None
        self.y: G = None
        self.t: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: A = None
        self.u: B = None
        self.w: J = None
        self.z: G = None
        self.x: C = None
        self.v: D = None
        self.y: H = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.x: F = None
        self.o: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.o: A = None
        self.s: D = None
        self.q: G = None
        self.y: J = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: A = None
        self.t: E = None
        self.r: J = None
        self.s: H = None
        self.y: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.w: E = None
        self.s: J = None
        self.q: G = None
        self.y: G = None
        self.t: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: A = None
        self.u: B = None
        self.w: J = None
        self.z: G = None
        self.x: C = None
        self.v: D = None
        self.y: H = None
        self.txt = txt

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

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

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