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

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

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

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

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

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

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

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

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

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

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