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

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

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.txt = txt

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

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

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

c.z = n
c.p = h
c.o = d
c.y = b
a.s = b
a.v = c
a.z = l
h.p = b
l.r = b
b.w = d
b.z = d
b.v = h
d.r = b
j.z = a
j.p = h
j.o = l
j.y = b
n.s = b
n.v = j
n.z = d
assert j.y.v.p.w.txt == "
class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.p: C = None
        self.o: D = None
        self.y: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.txt = txt

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

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

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

c.z = n
c.p = h
c.o = d
c.y = b
a.s = b
a.v = c
a.z = l
h.p = b
l.r = b
b.w = d
b.z = d
b.v = h
d.r = b
j.z = a
j.p = h
j.o = l
j.y = b
n.s = b
n.v = j
n.z = d
assert j.y.v.p.w.txt == "d"