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

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

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

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

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

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

d.t = l
m.u = d
m.y = b
m.t = l
m.w = l
h.z = f
h.w = f
h.v = d
h.o = l
f.y = c
f.v = l
f.u = h
f.x = e
l.w = j
b.u = d
b.y = e
b.t = l
b.w = l
e.u = d
e.y = b
e.t = l
e.w = l
j.z = f
j.w = f
j.v = d
j.o = l
c.z = f
c.w = f
c.v = d
c.o = l
assert m.u.t.w.o.w.v.t.w.z.txt == "
class A:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

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

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

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

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

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

d.t = l
m.u = d
m.y = b
m.t = l
m.w = l
h.z = f
h.w = f
h.v = d
h.o = l
f.y = c
f.v = l
f.u = h
f.x = e
l.w = j
b.u = d
b.y = e
b.t = l
b.w = l
e.u = d
e.y = b
e.t = l
e.w = l
j.z = f
j.w = f
j.v = d
j.o = l
c.z = f
c.w = f
c.v = d
c.o = l
assert m.u.t.w.o.w.v.t.w.z.txt == "f"