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

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

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

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

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

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

c.w = e
c.t = j
c.r = b
b.o = i
b.p = e
b.s = l
l.u = j
l.t = i
l.x = i
j.u = c
j.y = e
j.z = e
k.p = f
f.u = j
f.t = i
f.x = i
i.p = f
m.o = i
m.p = b
m.s = l
e.o = i
e.p = b
e.s = l
assert f.u.y.o.p.u.u.t.y.txt == "
class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.t: D = None
        self.r: B = None
        self.txt = txt

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

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

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

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

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

c.w = e
c.t = j
c.r = b
b.o = i
b.p = e
b.s = l
l.u = j
l.t = i
l.x = i
j.u = c
j.y = e
j.z = e
k.p = f
f.u = j
f.t = i
f.x = i
i.p = f
m.o = i
m.p = b
m.s = l
e.o = i
e.p = b
e.s = l
assert f.u.y.o.p.u.u.t.y.txt == "e"