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

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

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

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

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

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

l.t = c
i.o = f
i.t = g
i.z = g
c.y = m
c.p = m
c.u = n
n.s = a
m.w = f
m.p = j
m.o = j
m.y = i
m.s = l
f.t = c
g.o = l
g.t = i
g.z = i
j.w = l
j.p = m
j.o = m
j.y = i
j.s = f
a.o = f
a.t = g
a.z = g
assert g.t.t.t.o.t.p.w.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

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

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

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

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

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

l.t = c
i.o = f
i.t = g
i.z = g
c.y = m
c.p = m
c.u = n
n.s = a
m.w = f
m.p = j
m.o = j
m.y = i
m.s = l
f.t = c
g.o = l
g.t = i
g.z = i
j.w = l
j.p = m
j.o = m
j.y = i
j.s = f
a.o = f
a.t = g
a.z = g
assert g.t.t.t.o.t.p.w.txt == "f"