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

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

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

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

f = A("f")
a = B("a")
c = C("c")
n = D("n")
b = C("b")
h = A("h")
j = D("j")
l = B("l")
d = C("d")

f.s = h
f.z = h
f.p = h
a.u = f
a.q = l
a.s = l
a.w = d
c.s = j
n.t = d
n.y = j
n.v = h
n.x = a
b.s = j
h.s = f
h.z = f
h.p = f
j.t = c
j.y = n
j.v = f
j.x = a
l.u = f
l.q = a
l.s = a
l.w = c
d.s = n
assert b.s.v.s.s.z.s.txt == "
class A:
    def __init__(self, txt: str):
        self.s: A = None
        self.z: A = None
        self.p: A = None
        self.txt = txt

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

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

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

f = A("f")
a = B("a")
c = C("c")
n = D("n")
b = C("b")
h = A("h")
j = D("j")
l = B("l")
d = C("d")

f.s = h
f.z = h
f.p = h
a.u = f
a.q = l
a.s = l
a.w = d
c.s = j
n.t = d
n.y = j
n.v = h
n.x = a
b.s = j
h.s = f
h.z = f
h.p = f
j.t = c
j.y = n
j.v = f
j.x = a
l.u = f
l.q = a
l.s = a
l.w = c
d.s = n
assert b.s.v.s.s.z.s.txt == "f"