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

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

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

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

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

j.u = k
j.r = f
j.v = n
j.p = l
e.y = d
e.r = j
e.z = k
d.p = j
d.z = e
c.o = d
c.w = k
c.p = a
c.u = j
a.p = j
a.z = k
k.y = d
k.r = n
k.z = e
l.o = d
l.w = k
l.p = a
l.u = j
g.p = n
g.z = e
f.o = a
f.p = a
f.w = k
f.u = j
n.u = e
n.r = l
n.v = j
n.p = f
assert l.u.v.r.o.p.v.p.w.z.txt == "
class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.r: D = None
        self.v: A = None
        self.p: D = None
        self.txt = txt

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

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

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

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

j.u = k
j.r = f
j.v = n
j.p = l
e.y = d
e.r = j
e.z = k
d.p = j
d.z = e
c.o = d
c.w = k
c.p = a
c.u = j
a.p = j
a.z = k
k.y = d
k.r = n
k.z = e
l.o = d
l.w = k
l.p = a
l.u = j
g.p = n
g.z = e
f.o = a
f.p = a
f.w = k
f.u = j
n.u = e
n.r = l
n.v = j
n.p = f
assert l.u.v.r.o.p.v.p.w.z.txt == "e"