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

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

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

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

c = A("c")
l = B("l")
k = C("k")
g = D("g")
f = D("f")
d = B("d")
a = B("a")
b = A("b")

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

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

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

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

c = A("c")
l = B("l")
k = C("k")
g = D("g")
f = D("f")
d = B("d")
a = B("a")
b = A("b")

c.y = k
l.o = k
k.u = a
g.o = k
g.w = k
g.s = k
g.x = a
f.o = k
f.w = k
f.s = k
f.x = l
d.o = k
a.o = k
b.y = k
assert a.o.u.o.u.o.u.o.txt == "k"