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

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

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

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

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

i = A("i")
k = B("k")
m = C("m")
n = D("n")
g = E("g")
e = C("e")
c = D("c")

i.x = g
i.r = m
k.o = g
m.t = e
m.w = g
m.u = n
n.y = k
n.o = i
n.x = m
g.u = m
e.t = m
e.w = g
e.u = c
c.y = k
c.o = i
c.x = m
assert c.o.x.u.u.y.txt == "
class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.r: C = None
        self.txt = txt

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

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

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

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

i = A("i")
k = B("k")
m = C("m")
n = D("n")
g = E("g")
e = C("e")
c = D("c")

i.x = g
i.r = m
k.o = g
m.t = e
m.w = g
m.u = n
n.y = k
n.o = i
n.x = m
g.u = m
e.t = m
e.w = g
e.u = c
c.y = k
c.o = i
c.x = m
assert c.o.x.u.u.y.txt == "k"