class A:
    def __init__(self, txt: str):
        self.o: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: G = None
        self.q: J = None
        self.v: D = None
        self.o: D = None
        self.u: H = None
        self.x: J = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: C = None
        self.p: G = None
        self.z: C = None
        self.v: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: F = None
        self.r: A = None
        self.u: C = None
        self.p: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.s: F = None
        self.w: J = None
        self.u: H = None
        self.x: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.t: I = None
        self.x: D = None
        self.r: E = None
        self.p: E = None
        self.v: C = None
        self.w: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.w: G = None
        self.q: J = None
        self.v: D = None
        self.o: D = None
        self.u: H = None
        self.x: J = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: C = None
        self.p: G = None
        self.z: C = None
        self.v: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: F = None
        self.r: A = None
        self.u: C = None
        self.p: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.s: F = None
        self.w: J = None
        self.u: H = None
        self.x: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.t: I = None
        self.x: D = None
        self.r: E = None
        self.p: E = None
        self.v: C = None
        self.w: D = None
        self.txt = txt

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

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