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

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

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

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.txt = txt

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

m = A("m")
n = B("n")
j = C("j")
h = D("h")
f = E("f")
a = A("a")
e = E("e")
i = B("i")

m.u = a
n.r = f
n.o = f
n.u = i
j.o = i
j.r = f
h.s = a
f.x = e
f.o = n
f.y = h
a.u = m
e.x = f
e.o = n
e.y = h
i.r = e
i.o = e
i.u = n
assert e.y.s.u.u.txt == "
class A:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.txt = txt

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

m = A("m")
n = B("n")
j = C("j")
h = D("h")
f = E("f")
a = A("a")
e = E("e")
i = B("i")

m.u = a
n.r = f
n.o = f
n.u = i
j.o = i
j.r = f
h.s = a
f.x = e
f.o = n
f.y = h
a.u = m
e.x = f
e.o = n
e.y = h
i.r = e
i.o = e
i.u = n
assert e.y.s.u.u.txt == "a"