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

class B:
    def __init__(self, txt: str):
        self.x: J = None
        self.y: G = None
        self.t: H = None
        self.w: D = None
        self.o: F = None
        self.v: J = None
        self.s: G = None
        self.z: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: G = None
        self.x: I = None
        self.t: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.z: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.o: C = None
        self.y: I = None
        self.s: C = None
        self.p: D = None
        self.x: A = None
        self.v: C = None
        self.u: B = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.t: C = None
        self.v: I = None
        self.z: B = None
        self.u: A = None
        self.p: G = None
        self.y: B = None
        self.r: H = None
        self.o: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.x: J = None
        self.y: G = None
        self.t: H = None
        self.w: D = None
        self.o: F = None
        self.v: J = None
        self.s: G = None
        self.z: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: G = None
        self.x: I = None
        self.t: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.z: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.o: C = None
        self.y: I = None
        self.s: C = None
        self.p: D = None
        self.x: A = None
        self.v: C = None
        self.u: B = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.t: C = None
        self.v: I = None
        self.z: B = None
        self.u: A = None
        self.p: G = None
        self.y: B = None
        self.r: H = None
        self.o: D = None
        self.txt = txt

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

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