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

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

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

class D:
    def __init__(self, txt: str):
        self.x: J = None
        self.u: E = None
        self.w: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: G = None
        self.w: G = None
        self.o: H = None
        self.p: D = None
        self.s: A = None
        self.u: H = None
        self.v: E = None
        self.t: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: H = None
        self.v: I = None
        self.s: C = None
        self.q: E = None
        self.r: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: F = None
        self.u: E = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.x: J = None
        self.u: E = None
        self.w: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: G = None
        self.w: G = None
        self.o: H = None
        self.p: D = None
        self.s: A = None
        self.u: H = None
        self.v: E = None
        self.t: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: H = None
        self.v: I = None
        self.s: C = None
        self.q: E = None
        self.r: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: F = None
        self.u: E = None
        self.txt = txt

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

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

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

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