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

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

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.w: B = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.w: B = None
        self.txt = txt

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

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

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

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