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

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

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

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

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

e.z = b
e.s = b
e.r = b
e.u = n
m.u = k
b.s = l
k.v = b
g.v = b
l.u = f
a.z = b
a.s = b
a.r = b
a.u = n
j.v = b
f.v = b
n.z = b
n.s = b
n.r = b
n.u = a
assert b.s.u.v.s.u.txt == "
class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.u: A = None
        self.s: C = None
        self.r: C = None
        self.txt = txt

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

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

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

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

e.z = b
e.s = b
e.r = b
e.u = n
m.u = k
b.s = l
k.v = b
g.v = b
l.u = f
a.z = b
a.s = b
a.r = b
a.u = n
j.v = b
f.v = b
n.z = b
n.s = b
n.r = b
n.u = a
assert b.s.u.v.s.u.txt == "f"