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

class B:
    def __init__(self, txt: str):
        self.z: I = None
        self.w: D = None
        self.q: I = None
        self.v: D = None
        self.u: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: I = None
        self.p: H = None
        self.w: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.w: B = None
        self.s: F = None
        self.r: H = None
        self.o: F = None
        self.p: I = None
        self.t: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: J = None
        self.u: I = None
        self.q: I = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.r: C = None
        self.q: C = None
        self.s: D = None
        self.v: C = None
        self.u: G = None
        self.p: I = None
        self.o: B = None
        self.y: I = None
        self.x: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: C = None
        self.o: G = None
        self.p: D = None
        self.x: E = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.t: E = None
        self.x: A = None
        self.s: E = None
        self.p: F = None
        self.r: C = None
        self.q: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: I = None
        self.w: D = None
        self.q: I = None
        self.v: D = None
        self.u: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: I = None
        self.p: H = None
        self.w: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.w: B = None
        self.s: F = None
        self.r: H = None
        self.o: F = None
        self.p: I = None
        self.t: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: J = None
        self.u: I = None
        self.q: I = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.r: C = None
        self.q: C = None
        self.s: D = None
        self.v: C = None
        self.u: G = None
        self.p: I = None
        self.o: B = None
        self.y: I = None
        self.x: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: C = None
        self.o: G = None
        self.p: D = None
        self.x: E = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.t: E = None
        self.x: A = None
        self.s: E = None
        self.p: F = None
        self.r: C = None
        self.q: B = None
        self.txt = txt

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

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