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

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.z: J = None
        self.x: J = None
        self.w: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: G = None
        self.w: A = None
        self.v: D = None
        self.y: E = None
        self.r: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: F = None
        self.w: C = None
        self.p: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.z: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: D = None
        self.w: H = None
        self.y: I = None
        self.p: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.u: I = None
        self.y: E = None
        self.s: F = None
        self.r: B = None
        self.t: I = None
        self.txt = txt

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

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

l = A("l")
a = B("a")
g = C("g")
m = D("m")
h = E("h")
f = F("f")
d = G("d")
e = H("e")
n = I("n")
i = J("i")

l.q = e
a.y = m
a.w = m
a.z = i
a.x = i
g.t = d
g.w = l
g.v = m
g.y = h
g.r = a
m.t = f
m.w = g
m.p = a
h.t = m
h.z = m
f.s = m
f.w = e
f.y = n
f.p = g
d.w = e
d.q = e
d.z = a
d.p = n
d.v = n
d.y = g
d.s = m
e.u = n
e.t = n
e.y = h
e.s = f
e.r = a
n.r = l
n.x = l
n.p = f
n.y = f
n.w = g
n.v = g
n.t = g
n.q = a
n.o = m
i.v = m
i.r = a
i.u = g
i.o = f
i.s = f
i.w = l
i.y = l
i.t = h
i.p = h
assert l.q.s.p.y.z.t.w.u.txt == "
class A:
    def __init__(self, txt: str):
        self.q: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.z: J = None
        self.x: J = None
        self.w: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: G = None
        self.w: A = None
        self.v: D = None
        self.y: E = None
        self.r: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: F = None
        self.w: C = None
        self.p: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.z: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: D = None
        self.w: H = None
        self.y: I = None
        self.p: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.u: I = None
        self.y: E = None
        self.s: F = None
        self.r: B = None
        self.t: I = None
        self.txt = txt

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

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

l = A("l")
a = B("a")
g = C("g")
m = D("m")
h = E("h")
f = F("f")
d = G("d")
e = H("e")
n = I("n")
i = J("i")

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