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

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

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

class D:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.q: H = None
        self.o: C = None
        self.t: C = None
        self.u: C = None
        self.r: A = None
        self.z: F = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.q: H = None
        self.o: C = None
        self.t: C = None
        self.u: C = None
        self.r: A = None
        self.z: F = None
        self.txt = txt

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

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

d.t = e
i.u = n
i.p = h
m.y = n
m.w = i
e.t = n
n.u = d
f.x = m
f.s = a
h.q = k
h.o = m
h.t = m
h.u = m
h.r = d
h.z = a
k.p = d
k.o = d
k.r = d
k.s = n
k.z = n
k.u = l
k.w = h
k.t = e
l.u = n
l.p = h
a.x = m
a.s = f
assert k.t.t.u.t.t.u.t.t.u.t.txt == "e"