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

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

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

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

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

d = A("d")
n = B("n")
j = C("j")
a = D("a")
l = E("l")
h = B("h")
g = D("g")
i = A("i")

d.r = l
n.s = g
n.o = l
n.v = l
n.p = h
n.z = j
j.s = h
a.p = j
a.x = j
l.o = g
l.s = i
h.s = g
h.o = l
h.v = l
h.p = n
h.z = j
g.p = j
g.x = j
i.r = l
assert i.r.o.x.s.z.txt == "
class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.txt = txt

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

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

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

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

d = A("d")
n = B("n")
j = C("j")
a = D("a")
l = E("l")
h = B("h")
g = D("g")
i = A("i")

d.r = l
n.s = g
n.o = l
n.v = l
n.p = h
n.z = j
j.s = h
a.p = j
a.x = j
l.o = g
l.s = i
h.s = g
h.o = l
h.v = l
h.p = n
h.z = j
g.p = j
g.x = j
i.r = l
assert i.r.o.x.s.z.txt == "j"