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

class B:
    def __init__(self, txt: str):
        self.y: C = None
        self.o: C = None
        self.p: C = None
        self.u: C = None
        self.txt = txt

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

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

h = A("h")
i = B("i")
e = C("e")
f = D("f")
k = D("k")
a = A("a")

h.z = a
h.s = k
h.v = i
i.y = e
i.o = e
i.p = e
i.u = e
e.r = i
e.s = k
e.u = k
f.p = e
k.p = e
a.z = h
a.s = k
a.v = i
assert e.u.p.r.p.r.txt == "
class A:
    def __init__(self, txt: str):
        self.z: A = None
        self.s: D = None
        self.v: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: C = None
        self.o: C = None
        self.p: C = None
        self.u: C = None
        self.txt = txt

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

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

h = A("h")
i = B("i")
e = C("e")
f = D("f")
k = D("k")
a = A("a")

h.z = a
h.s = k
h.v = i
i.y = e
i.o = e
i.p = e
i.u = e
e.r = i
e.s = k
e.u = k
f.p = e
k.p = e
a.z = h
a.s = k
a.v = i
assert e.u.p.r.p.r.txt == "i"