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

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

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

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.v: B = None
        self.txt = txt

d = A("d")
b = B("b")
g = C("g")
l = D("l")
c = D("c")
i = C("i")
m = D("m")
k = A("k")
f = D("f")
e = B("e")

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

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

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

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.v: B = None
        self.txt = txt

d = A("d")
b = B("b")
g = C("g")
l = D("l")
c = D("c")
i = C("i")
m = D("m")
k = A("k")
f = D("f")
e = B("e")

d.y = k
d.x = e
d.s = l
d.u = g
b.p = f
b.y = d
g.u = i
g.z = i
g.w = l
g.y = k
l.r = b
l.v = b
c.r = b
c.v = b
i.u = g
i.z = g
i.w = l
i.y = d
m.r = b
m.v = b
k.y = d
k.x = b
k.s = f
k.u = g
f.r = e
f.v = b
e.p = f
e.y = k
assert c.r.p.v.y.y.txt == "k"