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

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

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

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

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

b = A("b")
k = B("k")
m = C("m")
g = D("g")
a = E("a")
n = A("n")
d = E("d")
f = C("f")
e = C("e")
c = D("c")

b.o = m
b.u = m
b.s = n
k.x = n
m.u = d
g.x = k
a.r = b
a.y = e
n.o = e
n.u = m
n.s = b
d.r = n
d.y = m
f.u = a
e.u = a
c.x = k
assert e.u.y.u.y.u.txt == "
class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.u: C = None
        self.s: A = None
        self.txt = txt

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

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

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

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

b = A("b")
k = B("k")
m = C("m")
g = D("g")
a = E("a")
n = A("n")
d = E("d")
f = C("f")
e = C("e")
c = D("c")

b.o = m
b.u = m
b.s = n
k.x = n
m.u = d
g.x = k
a.r = b
a.y = e
n.o = e
n.u = m
n.s = b
d.r = n
d.y = m
f.u = a
e.u = a
c.x = k
assert e.u.y.u.y.u.txt == "a"