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

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

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

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

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

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

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

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

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

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

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

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

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