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

class B:
    def __init__(self, txt: str):
        self.z: B = None
        self.x: B = None
        self.t: B = None
        self.s: B = None
        self.txt = txt

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

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

h = A("h")
d = B("d")
a = C("a")
n = D("n")
l = B("l")
i = B("i")
f = D("f")
c = A("c")

h.p = l
h.v = l
h.x = c
h.u = a
d.z = i
d.x = i
d.t = i
d.s = i
a.z = i
a.r = l
a.x = f
a.o = d
n.z = f
n.t = f
n.v = l
n.u = a
l.z = d
l.x = d
l.s = d
l.t = i
i.z = d
i.x = d
i.t = d
i.s = d
f.z = n
f.t = n
f.v = l
f.u = a
c.p = i
c.x = h
c.v = d
c.u = a
assert h.v.t.t.x.t.z.t.t.txt == "
class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.x: A = None
        self.v: B = None
        self.u: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: B = None
        self.x: B = None
        self.t: B = None
        self.s: B = None
        self.txt = txt

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

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

h = A("h")
d = B("d")
a = C("a")
n = D("n")
l = B("l")
i = B("i")
f = D("f")
c = A("c")

h.p = l
h.v = l
h.x = c
h.u = a
d.z = i
d.x = i
d.t = i
d.s = i
a.z = i
a.r = l
a.x = f
a.o = d
n.z = f
n.t = f
n.v = l
n.u = a
l.z = d
l.x = d
l.s = d
l.t = i
i.z = d
i.x = d
i.t = d
i.s = d
f.z = n
f.t = n
f.v = l
f.u = a
c.p = i
c.x = h
c.v = d
c.u = a
assert h.v.t.t.x.t.z.t.t.txt == "i"