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

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

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

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

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

f = A("f")
h = B("h")
e = C("e")
c = D("c")
i = E("i")
m = D("m")
g = A("g")
d = A("d")

f.u = i
f.p = i
f.t = m
f.s = e
f.o = h
h.q = g
h.t = g
e.w = d
e.p = g
e.r = i
e.x = c
e.t = c
c.o = h
c.s = m
i.w = h
m.o = h
m.s = c
g.u = i
g.p = i
g.t = c
g.s = e
g.o = h
d.u = i
d.p = i
d.t = m
d.s = e
d.o = h
assert e.p.t.s.txt == "
class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.t: D = None
        self.s: C = None
        self.o: B = None
        self.p: E = None
        self.txt = txt

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

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

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

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

f = A("f")
h = B("h")
e = C("e")
c = D("c")
i = E("i")
m = D("m")
g = A("g")
d = A("d")

f.u = i
f.p = i
f.t = m
f.s = e
f.o = h
h.q = g
h.t = g
e.w = d
e.p = g
e.r = i
e.x = c
e.t = c
c.o = h
c.s = m
i.w = h
m.o = h
m.s = c
g.u = i
g.p = i
g.t = c
g.s = e
g.o = h
d.u = i
d.p = i
d.t = m
d.s = e
d.o = h
assert e.p.t.s.txt == "m"