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

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

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

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

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

e.z = c
e.v = d
e.s = b
l.p = j
l.w = j
l.y = d
n.z = b
j.y = b
j.v = b
c.z = b
k.y = e
k.v = b
f.z = c
f.v = d
f.s = e
b.z = c
b.v = d
b.s = e
d.p = k
d.w = j
d.y = l
assert b.z.z.v.w.y.txt == "
class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.v: B = None
        self.s: A = None
        self.txt = txt

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

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

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

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

e.z = c
e.v = d
e.s = b
l.p = j
l.w = j
l.y = d
n.z = b
j.y = b
j.v = b
c.z = b
k.y = e
k.v = b
f.z = c
f.v = d
f.s = e
b.z = c
b.v = d
b.s = e
d.p = k
d.w = j
d.y = l
assert b.z.z.v.w.y.txt == "b"