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

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

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

class D:
    def __init__(self, txt: str):
        self.y: E = None
        self.u: A = None
        self.p: C = None
        self.v: B = None
        self.q: C = None
        self.txt = txt

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

m = A("m")
c = B("c")
e = C("e")
g = D("g")
l = E("l")
b = B("b")
k = A("k")

m.s = e
c.x = l
e.w = g
e.u = b
e.o = l
g.y = l
g.u = k
g.p = e
g.q = e
g.v = c
l.w = g
l.r = e
b.x = l
k.s = e
assert g.u.s.u.x.txt == "
class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.y: E = None
        self.u: A = None
        self.p: C = None
        self.v: B = None
        self.q: C = None
        self.txt = txt

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

m = A("m")
c = B("c")
e = C("e")
g = D("g")
l = E("l")
b = B("b")
k = A("k")

m.s = e
c.x = l
e.w = g
e.u = b
e.o = l
g.y = l
g.u = k
g.p = e
g.q = e
g.v = c
l.w = g
l.r = e
b.x = l
k.s = e
assert g.u.s.u.x.txt == "l"