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

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

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.x: B = None
        self.o: C = None
        self.q: B = None
        self.txt = txt

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

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

d = A("d")
b = B("b")
j = C("j")
m = D("m")
i = E("i")
e = C("e")
g = A("g")
n = A("n")

d.o = m
d.w = g
d.u = e
b.o = i
b.w = e
b.y = d
j.r = d
j.x = b
j.q = b
j.o = e
m.t = i
m.z = b
m.v = n
m.q = d
i.u = b
i.y = e
e.r = d
e.x = b
e.q = b
e.o = j
g.o = m
g.w = n
g.u = e
n.o = m
n.w = d
n.u = e
assert i.u.o.u.y.u.txt == "
class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.w: A = None
        self.u: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.x: B = None
        self.o: C = None
        self.q: B = None
        self.txt = txt

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

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

d = A("d")
b = B("b")
j = C("j")
m = D("m")
i = E("i")
e = C("e")
g = A("g")
n = A("n")

d.o = m
d.w = g
d.u = e
b.o = i
b.w = e
b.y = d
j.r = d
j.x = b
j.q = b
j.o = e
m.t = i
m.z = b
m.v = n
m.q = d
i.u = b
i.y = e
e.r = d
e.x = b
e.q = b
e.o = j
g.o = m
g.w = n
g.u = e
n.o = m
n.w = d
n.u = e
assert i.u.o.u.y.u.txt == "e"