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

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

class C:
    def __init__(self, txt: str):
        self.o: H = None
        self.x: F = None
        self.s: J = None
        self.q: A = None
        self.u: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: C = None
        self.x: C = None
        self.o: E = None
        self.s: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.t: J = None
        self.q: B = None
        self.s: J = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: F = None
        self.s: B = None
        self.o: C = None
        self.q: J = None
        self.r: I = None
        self.y: J = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: J = None
        self.r: C = None
        self.t: D = None
        self.txt = txt

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

d = A("d")
l = B("l")
i = C("i")
m = D("m")
f = E("f")
h = F("h")
c = G("c")
b = H("b")
j = I("j")
e = J("e")

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

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

class C:
    def __init__(self, txt: str):
        self.o: H = None
        self.x: F = None
        self.s: J = None
        self.q: A = None
        self.u: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: C = None
        self.x: C = None
        self.o: E = None
        self.s: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.t: J = None
        self.q: B = None
        self.s: J = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: F = None
        self.s: B = None
        self.o: C = None
        self.q: J = None
        self.r: I = None
        self.y: J = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: J = None
        self.r: C = None
        self.t: D = None
        self.txt = txt

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

d = A("d")
l = B("l")
i = C("i")
m = D("m")
f = E("f")
h = F("h")
c = G("c")
b = H("b")
j = I("j")
e = J("e")

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