class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.r: C = None
        self.z: A = None
        self.o: E = None
        self.u: A = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.x: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.p: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: E = None
        self.s: E = None
        self.txt = txt

k = A("k")
l = B("l")
j = C("j")
m = D("m")
e = E("e")
g = E("g")
i = B("i")
f = A("f")
a = E("a")

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

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

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.x: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.p: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: E = None
        self.s: E = None
        self.txt = txt

k = A("k")
l = B("l")
j = C("j")
m = D("m")
e = E("e")
g = E("g")
i = B("i")
f = A("f")
a = E("a")

k.t = m
k.r = j
k.z = f
k.u = f
k.o = a
l.q = j
l.t = i
j.p = a
j.x = k
m.x = j
m.p = j
e.w = a
e.s = g
g.w = a
g.s = e
i.q = j
i.t = l
f.t = m
f.r = j
f.z = k
f.u = k
f.o = e
a.w = e
a.s = e
assert f.o.w.s.w.w.w.w.txt == "e"