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

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

class C:
    def __init__(self, txt: str):
        self.x: C = None
        self.r: D = None
        self.p: A = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.x: C = None
        self.r: D = None
        self.p: A = None
        self.txt = txt

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

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

f.s = m
f.o = j
j.z = l
d.x = c
d.r = m
d.p = n
m.x = h
m.u = n
m.p = b
m.v = j
h.x = c
h.r = m
h.p = n
n.s = b
n.o = l
b.x = d
b.u = n
b.p = m
b.v = j
c.x = d
c.r = b
c.p = n
l.z = j
assert f.s.p.x.p.o.z.z.z.z.txt == "l"