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

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

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

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

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

d = A("d")
n = B("n")
b = C("b")
k = D("k")
h = E("h")
l = C("l")
e = E("e")
f = A("f")
i = B("i")

d.r = i
d.v = i
d.p = f
d.y = b
d.x = l
n.v = i
n.r = l
n.y = k
b.t = k
k.s = e
k.v = n
k.p = i
k.z = l
h.v = e
h.p = k
l.t = k
e.v = h
e.p = k
f.r = i
f.p = d
f.y = b
f.v = n
f.x = l
i.v = n
i.r = b
i.y = k
assert k.s.p.z.t.p.v.v.txt == "
class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.p: A = None
        self.y: C = None
        self.v: B = None
        self.x: C = None
        self.txt = txt

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

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

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

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

d = A("d")
n = B("n")
b = C("b")
k = D("k")
h = E("h")
l = C("l")
e = E("e")
f = A("f")
i = B("i")

d.r = i
d.v = i
d.p = f
d.y = b
d.x = l
n.v = i
n.r = l
n.y = k
b.t = k
k.s = e
k.v = n
k.p = i
k.z = l
h.v = e
h.p = k
l.t = k
e.v = h
e.p = k
f.r = i
f.p = d
f.y = b
f.v = n
f.x = l
i.v = n
i.r = b
i.y = k
assert k.s.p.z.t.p.v.v.txt == "i"