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

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

class C:
    def __init__(self, txt: str):
        self.o: F = None
        self.r: H = None
        self.w: D = None
        self.s: I = None
        self.y: G = None
        self.x: G = None
        self.u: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: B = None
        self.s: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: C = None
        self.v: I = None
        self.q: H = None
        self.z: C = None
        self.s: H = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.w: D = None
        self.t: D = None
        self.q: F = None
        self.z: C = None
        self.u: J = None
        self.v: F = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: F = None
        self.r: H = None
        self.w: D = None
        self.s: I = None
        self.y: G = None
        self.x: G = None
        self.u: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: B = None
        self.s: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: C = None
        self.v: I = None
        self.q: H = None
        self.z: C = None
        self.s: H = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.w: D = None
        self.t: D = None
        self.q: F = None
        self.z: C = None
        self.u: J = None
        self.v: F = None
        self.txt = txt

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

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

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