class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.o: J = None
        self.r: G = None
        self.v: D = None
        self.z: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: H = None
        self.u: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.q: E = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.o: J = None
        self.p: F = None
        self.t: F = None
        self.x: A = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.y: J = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: H = None
        self.u: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.q: E = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.o: J = None
        self.p: F = None
        self.t: F = None
        self.x: A = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.y: J = None
        self.txt = txt

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

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

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