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

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

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.u: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: I = None
        self.x: H = None
        self.t: E = None
        self.u: H = None
        self.o: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.u: H = None
        self.z: B = None
        self.v: I = None
        self.w: C = None
        self.q: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: D = None
        self.s: I = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.x: C = None
        self.p: F = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.u: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: I = None
        self.x: H = None
        self.t: E = None
        self.u: H = None
        self.o: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.u: H = None
        self.z: B = None
        self.v: I = None
        self.w: C = None
        self.q: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: D = None
        self.s: I = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.x: C = None
        self.p: F = None
        self.txt = txt

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

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

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