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

class B:
    def __init__(self, txt: str):
        self.u: H = None
        self.p: A = None
        self.z: J = None
        self.r: D = None
        self.v: J = None
        self.x: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: D = None
        self.z: F = None
        self.u: J = None
        self.y: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: A = None
        self.p: J = None
        self.v: F = None
        self.u: F = None
        self.z: E = None
        self.q: A = None
        self.w: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: G = None
        self.r: J = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: A = None
        self.w: I = None
        self.q: G = None
        self.t: H = None
        self.y: H = None
        self.r: J = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.r: B = None
        self.y: E = None
        self.p: C = None
        self.w: C = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.u: H = None
        self.p: A = None
        self.z: J = None
        self.r: D = None
        self.v: J = None
        self.x: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: D = None
        self.z: F = None
        self.u: J = None
        self.y: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: A = None
        self.p: J = None
        self.v: F = None
        self.u: F = None
        self.z: E = None
        self.q: A = None
        self.w: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: G = None
        self.r: J = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: A = None
        self.w: I = None
        self.q: G = None
        self.t: H = None
        self.y: H = None
        self.r: J = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.r: B = None
        self.y: E = None
        self.p: C = None
        self.w: C = None
        self.txt = txt

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

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

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