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

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: I = None
        self.x: G = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.p: J = None
        self.u: G = None
        self.v: G = None
        self.y: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: F = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.q: E = None
        self.o: H = None
        self.z: I = None
        self.r: F = None
        self.v: G = None
        self.u: C = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: I = None
        self.x: G = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.p: J = None
        self.u: G = None
        self.v: G = None
        self.y: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: F = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.q: E = None
        self.o: H = None
        self.z: I = None
        self.r: F = None
        self.v: G = None
        self.u: C = None
        self.txt = txt

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

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