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

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

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

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

l = A("l")
k = B("k")
d = C("d")
i = D("i")
f = D("f")
j = B("j")
m = C("m")
h = A("h")
a = B("a")
b = C("b")

l.p = h
l.v = h
l.z = i
l.x = k
k.w = l
k.u = j
k.t = m
k.v = i
d.s = b
d.t = h
d.r = h
d.w = k
i.z = h
i.s = a
f.z = l
f.s = a
j.w = h
j.u = a
j.t = m
j.v = i
m.s = b
m.t = l
m.r = h
m.w = j
h.p = l
h.v = l
h.z = f
h.x = a
a.w = h
a.u = j
a.t = d
a.v = f
b.s = m
b.t = h
b.r = l
b.w = j
assert f.z.v.z.s.txt == "
class A:
    def __init__(self, txt: str):
        self.p: A = None
        self.z: D = None
        self.x: B = None
        self.v: A = None
        self.txt = txt

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

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

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

l = A("l")
k = B("k")
d = C("d")
i = D("i")
f = D("f")
j = B("j")
m = C("m")
h = A("h")
a = B("a")
b = C("b")

l.p = h
l.v = h
l.z = i
l.x = k
k.w = l
k.u = j
k.t = m
k.v = i
d.s = b
d.t = h
d.r = h
d.w = k
i.z = h
i.s = a
f.z = l
f.s = a
j.w = h
j.u = a
j.t = m
j.v = i
m.s = b
m.t = l
m.r = h
m.w = j
h.p = l
h.v = l
h.z = f
h.x = a
a.w = h
a.u = j
a.t = d
a.v = f
b.s = m
b.t = h
b.r = l
b.w = j
assert f.z.v.z.s.txt == "a"