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

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.t: D = None
        self.y: B = None
        self.s: C = None
        self.txt = txt

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

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

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

a.y = m
a.r = n
a.s = e
c.z = l
c.s = l
c.t = m
c.y = e
n.y = l
n.s = e
m.y = b
m.o = l
m.v = k
m.w = a
b.y = d
b.r = l
b.s = e
d.y = a
d.o = l
d.v = k
d.w = b
k.y = a
k.w = a
k.o = l
k.v = m
e.z = n
e.t = m
e.y = c
e.s = l
l.y = n
l.s = e
assert e.s.s.y.s.s.txt == "
class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.r: C = None
        self.s: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.t: D = None
        self.y: B = None
        self.s: C = None
        self.txt = txt

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

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

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

a.y = m
a.r = n
a.s = e
c.z = l
c.s = l
c.t = m
c.y = e
n.y = l
n.s = e
m.y = b
m.o = l
m.v = k
m.w = a
b.y = d
b.r = l
b.s = e
d.y = a
d.o = l
d.v = k
d.w = b
k.y = a
k.w = a
k.o = l
k.v = m
e.z = n
e.t = m
e.y = c
e.s = l
l.y = n
l.s = e
assert e.s.s.y.s.s.txt == "e"