class A:
    def __init__(self, txt: str):
        self.t: J = None
        self.v: F = None
        self.y: C = None
        self.q: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: I = None
        self.t: A = None
        self.q: A = None
        self.z: H = None
        self.x: A = None
        self.u: H = None
        self.p: D = None
        self.y: J = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.o: J = None
        self.p: H = None
        self.s: H = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.q: I = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: I = None
        self.t: A = None
        self.q: A = None
        self.z: H = None
        self.x: A = None
        self.u: H = None
        self.p: D = None
        self.y: J = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.o: J = None
        self.p: H = None
        self.s: H = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.q: I = None
        self.txt = txt

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

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

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

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