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

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

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

class D:
    def __init__(self, txt: str):
        self.v: E = None
        self.t: B = None
        self.w: C = None
        self.x: B = None
        self.z: B = None
        self.txt = txt

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

c = A("c")
d = B("d")
i = C("i")
m = D("m")
g = E("g")
n = A("n")
a = B("a")
l = E("l")
e = E("e")

c.t = n
d.s = m
d.q = n
d.x = e
i.u = m
i.y = a
m.v = e
m.t = a
m.z = a
m.w = i
m.x = d
g.p = a
g.v = m
n.t = c
a.s = m
a.q = n
a.x = g
l.p = d
l.v = m
e.p = d
e.v = m
assert c.t.t.t.t.t.t.t.t.t.txt == "
class A:
    def __init__(self, txt: str):
        self.t: A = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.v: E = None
        self.t: B = None
        self.w: C = None
        self.x: B = None
        self.z: B = None
        self.txt = txt

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

c = A("c")
d = B("d")
i = C("i")
m = D("m")
g = E("g")
n = A("n")
a = B("a")
l = E("l")
e = E("e")

c.t = n
d.s = m
d.q = n
d.x = e
i.u = m
i.y = a
m.v = e
m.t = a
m.z = a
m.w = i
m.x = d
g.p = a
g.v = m
n.t = c
a.s = m
a.q = n
a.x = g
l.p = d
l.v = m
e.p = d
e.v = m
assert c.t.t.t.t.t.t.t.t.t.txt == "n"