class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.r: D = None
        self.s: C = None
        self.y: C = 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.t: D = None
        self.q: A = None
        self.v: C = None
        self.r: C = None
        self.txt = txt

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

d = A("d")
j = B("j")
l = C("l")
i = D("i")
a = B("a")
f = A("f")
b = D("b")
k = B("k")
e = A("e")
n = C("n")

d.v = n
d.r = i
d.s = l
d.y = l
j.x = d
l.t = i
l.q = e
l.v = n
l.r = n
i.z = e
i.o = f
i.s = n
i.y = b
a.x = e
f.v = l
f.s = l
f.y = l
f.r = i
b.z = d
b.o = e
b.s = n
b.y = i
k.x = e
e.v = n
e.y = n
e.r = i
e.s = l
n.t = b
n.q = d
n.v = l
n.r = l
assert b.y.y.s.txt == "
class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.r: D = None
        self.s: C = None
        self.y: C = 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.t: D = None
        self.q: A = None
        self.v: C = None
        self.r: C = None
        self.txt = txt

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

d = A("d")
j = B("j")
l = C("l")
i = D("i")
a = B("a")
f = A("f")
b = D("b")
k = B("k")
e = A("e")
n = C("n")

d.v = n
d.r = i
d.s = l
d.y = l
j.x = d
l.t = i
l.q = e
l.v = n
l.r = n
i.z = e
i.o = f
i.s = n
i.y = b
a.x = e
f.v = l
f.s = l
f.y = l
f.r = i
b.z = d
b.o = e
b.s = n
b.y = i
k.x = e
e.v = n
e.y = n
e.r = i
e.s = l
n.t = b
n.q = d
n.v = l
n.r = l
assert b.y.y.s.txt == "n"