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

class B:
    def __init__(self, txt: str):
        self.s: H = None
        self.q: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: A = None
        self.v: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: G = None
        self.v: D = None
        self.t: A = None
        self.o: G = None
        self.u: B = None
        self.z: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.u: B = None
        self.v: G = None
        self.s: C = None
        self.o: G = None
        self.w: D = None
        self.y: J = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: G = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.w: E = None
        self.o: H = None
        self.v: H = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.s: H = None
        self.q: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: A = None
        self.v: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: G = None
        self.v: D = None
        self.t: A = None
        self.o: G = None
        self.u: B = None
        self.z: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.u: B = None
        self.v: G = None
        self.s: C = None
        self.o: G = None
        self.w: D = None
        self.y: J = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: G = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.w: E = None
        self.o: H = None
        self.v: H = None
        self.txt = txt

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

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