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

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

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

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

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

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

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

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

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

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

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