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

class B:
    def __init__(self, txt: str):
        self.q: F = None
        self.t: H = None
        self.p: D = None
        self.r: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: G = None
        self.o: G = None
        self.t: F = None
        self.z: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: J = None
        self.u: G = None
        self.o: F = None
        self.s: F = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.p: E = None
        self.r: F = None
        self.x: B = None
        self.y: A = None
        self.o: A = None
        self.w: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: A = None
        self.p: H = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.o: I = None
        self.p: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: F = None
        self.t: H = None
        self.p: D = None
        self.r: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: G = None
        self.o: G = None
        self.t: F = None
        self.z: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: J = None
        self.u: G = None
        self.o: F = None
        self.s: F = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.p: E = None
        self.r: F = None
        self.x: B = None
        self.y: A = None
        self.o: A = None
        self.w: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: A = None
        self.p: H = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.o: I = None
        self.p: E = None
        self.txt = txt

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

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