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

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

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

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

j = A("j")
n = B("n")
k = C("k")
c = D("c")
f = A("f")
h = B("h")
i = C("i")
g = D("g")
l = B("l")

j.w = l
j.r = f
n.p = i
k.o = i
k.s = n
k.t = g
c.u = g
c.r = j
c.z = i
f.w = h
f.r = j
h.p = i
i.o = k
i.s = l
i.t = g
g.u = c
g.r = j
g.z = k
l.p = i
assert k.s.p.o.o.s.p.s.p.txt == "
class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.r: A = None
        self.txt = txt

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

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

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

j = A("j")
n = B("n")
k = C("k")
c = D("c")
f = A("f")
h = B("h")
i = C("i")
g = D("g")
l = B("l")

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