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

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

class C:
    def __init__(self, txt: str):
        self.w: G = None
        self.x: E = None
        self.v: A = None
        self.o: A = None
        self.q: G = None
        self.u: B = None
        self.y: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: G = None
        self.o: B = None
        self.w: C = None
        self.v: A = None
        self.s: B = None
        self.u: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: B = None
        self.y: E = None
        self.o: F = None
        self.u: E = None
        self.s: H = None
        self.x: D = None
        self.txt = txt

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

d = A("d")
i = B("i")
e = C("e")
n = D("n")
g = E("g")
m = F("m")
h = G("h")
b = H("b")
a = B("a")
k = D("k")

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

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

class C:
    def __init__(self, txt: str):
        self.w: G = None
        self.x: E = None
        self.v: A = None
        self.o: A = None
        self.q: G = None
        self.u: B = None
        self.y: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: G = None
        self.o: B = None
        self.w: C = None
        self.v: A = None
        self.s: B = None
        self.u: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: B = None
        self.y: E = None
        self.o: F = None
        self.u: E = None
        self.s: H = None
        self.x: D = None
        self.txt = txt

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

d = A("d")
i = B("i")
e = C("e")
n = D("n")
g = E("g")
m = F("m")
h = G("h")
b = H("b")
a = B("a")
k = D("k")

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