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

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

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.t: A = None
        self.z: A = None
        self.q: C = None
        self.v: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: C = None
        self.t: E = None
        self.y: C = None
        self.z: A = None
        self.x: E = None
        self.txt = txt

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

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

m.w = j
n.x = b
n.t = b
n.z = i
n.y = m
l.y = n
l.t = m
l.z = i
l.q = a
l.v = j
b.s = l
b.t = j
b.y = a
b.z = i
b.x = d
d.o = i
d.u = j
f.o = m
f.u = j
i.w = d
j.o = m
j.u = f
a.y = n
a.t = m
a.z = i
a.q = l
a.v = d
assert f.u.o.w.o.w.o.txt == "
class A:
    def __init__(self, txt: str):
        self.w: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.t: A = None
        self.z: A = None
        self.q: C = None
        self.v: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: C = None
        self.t: E = None
        self.y: C = None
        self.z: A = None
        self.x: E = None
        self.txt = txt

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

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

m.w = j
n.x = b
n.t = b
n.z = i
n.y = m
l.y = n
l.t = m
l.z = i
l.q = a
l.v = j
b.s = l
b.t = j
b.y = a
b.z = i
b.x = d
d.o = i
d.u = j
f.o = m
f.u = j
i.w = d
j.o = m
j.u = f
a.y = n
a.t = m
a.z = i
a.q = l
a.v = d
assert f.u.o.w.o.w.o.txt == "m"