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

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

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

class D:
    def __init__(self, txt: str):
        self.z: E = None
        self.q: C = None
        self.txt = txt

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

c = A("c")
k = B("k")
h = C("h")
l = D("l")
g = E("g")
e = B("e")
m = D("m")
b = B("b")
f = A("f")

c.s = m
k.t = e
h.o = g
h.p = g
h.u = f
h.r = b
l.z = g
l.q = h
g.o = m
g.v = h
e.t = k
m.z = g
m.q = h
b.t = k
f.s = l
assert e.t.t.t.t.t.t.t.txt == "
class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.z: E = None
        self.q: C = None
        self.txt = txt

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

c = A("c")
k = B("k")
h = C("h")
l = D("l")
g = E("g")
e = B("e")
m = D("m")
b = B("b")
f = A("f")

c.s = m
k.t = e
h.o = g
h.p = g
h.u = f
h.r = b
l.z = g
l.q = h
g.o = m
g.v = h
e.t = k
m.z = g
m.q = h
b.t = k
f.s = l
assert e.t.t.t.t.t.t.t.txt == "k"