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

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.t: C = None
        self.z: I = None
        self.q: D = None
        self.s: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: G = None
        self.o: H = None
        self.r: G = None
        self.y: B = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.p: C = None
        self.x: F = None
        self.z: H = None
        self.y: G = None
        self.q: D = None
        self.w: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.p: G = None
        self.s: H = None
        self.q: C = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.t: C = None
        self.z: I = None
        self.q: D = None
        self.s: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: G = None
        self.o: H = None
        self.r: G = None
        self.y: B = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.p: C = None
        self.x: F = None
        self.z: H = None
        self.y: G = None
        self.q: D = None
        self.w: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.p: G = None
        self.s: H = None
        self.q: C = None
        self.txt = txt

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

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