class A:
    def __init__(self, txt: str):
        self.x: D = None
        self.r: I = None
        self.z: F = None
        self.o: F = None
        self.p: I = None
        self.u: G = None
        self.y: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.x: F = None
        self.r: G = None
        self.s: G = None
        self.w: J = None
        self.t: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: C = None
        self.t: F = None
        self.o: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: E = None
        self.w: D = None
        self.s: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.o: A = None
        self.z: G = None
        self.v: G = None
        self.u: G = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.w: G = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.x: F = None
        self.r: G = None
        self.s: G = None
        self.w: J = None
        self.t: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: C = None
        self.t: F = None
        self.o: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: E = None
        self.w: D = None
        self.s: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.o: A = None
        self.z: G = None
        self.v: G = None
        self.u: G = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.w: G = None
        self.txt = txt

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

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