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

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

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

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

i = A("i")
j = B("j")
c = C("c")
h = D("h")
l = D("l")
e = A("e")
f = C("f")

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

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

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

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

i = A("i")
j = B("j")
c = C("c")
h = D("h")
l = D("l")
e = A("e")
f = C("f")

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