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

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

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

class D:
    def __init__(self, txt: str):
        self.q: E = None
        self.o: B = None
        self.y: J = None
        self.t: E = None
        self.r: F = None
        self.v: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: C = None
        self.w: B = None
        self.p: G = None
        self.q: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: B = None
        self.v: E = None
        self.x: D = None
        self.q: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: E = None
        self.x: G = None
        self.q: E = None
        self.s: B = None
        self.u: J = None
        self.o: B = None
        self.p: B = None
        self.z: B = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.q: E = None
        self.o: B = None
        self.y: J = None
        self.t: E = None
        self.r: F = None
        self.v: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: C = None
        self.w: B = None
        self.p: G = None
        self.q: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: B = None
        self.v: E = None
        self.x: D = None
        self.q: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: E = None
        self.x: G = None
        self.q: E = None
        self.s: B = None
        self.u: J = None
        self.o: B = None
        self.p: B = None
        self.z: B = None
        self.txt = txt

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

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

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

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