class A:
    def __init__(self, txt: str):
        self.z: F = None
        self.w: B = None
        self.r: I = None
        self.p: C = None
        self.u: B = None
        self.v: J = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.z: J = None
        self.x: I = None
        self.r: E = None
        self.p: H = None
        self.w: F = None
        self.o: I = None
        self.s: G = None
        self.t: C = None
        self.u: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: J = None
        self.s: A = None
        self.t: H = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.t: G = None
        self.o: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: D = None
        self.q: A = None
        self.z: A = None
        self.txt = txt

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

i = A("i")
d = B("d")
c = C("c")
k = D("k")
f = E("f")
j = F("j")
n = G("n")
g = H("g")
a = I("a")
m = J("m")

i.z = j
i.w = d
i.u = d
i.r = a
i.p = c
i.v = m
d.q = k
d.u = k
d.z = m
d.x = a
d.o = a
d.r = f
d.p = g
d.w = j
d.s = n
d.t = c
c.z = f
c.v = n
c.t = n
c.r = i
c.w = i
c.q = j
c.y = j
c.p = m
c.s = m
k.z = m
k.s = i
k.t = g
f.w = d
j.x = i
j.z = a
j.s = m
n.v = c
n.u = c
n.p = k
n.s = m
n.t = f
n.r = j
n.z = g
g.t = n
g.o = k
a.r = k
a.q = i
a.z = i
m.x = f
m.v = f
m.z = d
m.s = c
m.o = g
assert d.r.w.x.q.r.z.u.txt == "
class A:
    def __init__(self, txt: str):
        self.z: F = None
        self.w: B = None
        self.r: I = None
        self.p: C = None
        self.u: B = None
        self.v: J = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.z: J = None
        self.x: I = None
        self.r: E = None
        self.p: H = None
        self.w: F = None
        self.o: I = None
        self.s: G = None
        self.t: C = None
        self.u: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: J = None
        self.s: A = None
        self.t: H = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.t: G = None
        self.o: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: D = None
        self.q: A = None
        self.z: A = None
        self.txt = txt

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

i = A("i")
d = B("d")
c = C("c")
k = D("k")
f = E("f")
j = F("j")
n = G("n")
g = H("g")
a = I("a")
m = J("m")

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