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

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

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

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

l = A("l")
b = B("b")
j = C("j")
c = D("c")
e = B("e")
m = C("m")
n = A("n")
k = C("k")
a = B("a")
i = D("i")

l.z = a
l.v = i
l.p = n
b.s = a
j.w = l
j.s = m
j.t = e
c.o = l
c.p = a
c.t = i
c.w = i
e.s = b
m.w = n
m.s = j
m.t = b
n.z = e
n.v = i
n.p = l
k.w = n
k.s = j
k.t = e
a.s = e
i.o = n
i.p = b
i.t = c
i.w = c
assert i.p.s.s.s.s.s.txt == "
class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.v: D = None
        self.p: A = None
        self.txt = txt

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

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

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

l = A("l")
b = B("b")
j = C("j")
c = D("c")
e = B("e")
m = C("m")
n = A("n")
k = C("k")
a = B("a")
i = D("i")

l.z = a
l.v = i
l.p = n
b.s = a
j.w = l
j.s = m
j.t = e
c.o = l
c.p = a
c.t = i
c.w = i
e.s = b
m.w = n
m.s = j
m.t = b
n.z = e
n.v = i
n.p = l
k.w = n
k.s = j
k.t = e
a.s = e
i.o = n
i.p = b
i.t = c
i.w = c
assert i.p.s.s.s.s.s.txt == "e"