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

class B:
    def __init__(self, txt: str):
        self.w: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.s: A = None
        self.r: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: H = None
        self.q: G = None
        self.p: B = None
        self.o: H = None
        self.r: F = None
        self.v: I = None
        self.y: E = None
        self.x: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: I = None
        self.p: B = None
        self.s: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: F = None
        self.x: E = None
        self.s: A = None
        self.o: E = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.w: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.s: A = None
        self.r: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: H = None
        self.q: G = None
        self.p: B = None
        self.o: H = None
        self.r: F = None
        self.v: I = None
        self.y: E = None
        self.x: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: I = None
        self.p: B = None
        self.s: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: F = None
        self.x: E = None
        self.s: A = None
        self.o: E = None
        self.txt = txt

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

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

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

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

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