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

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

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

class D:
    def __init__(self, txt: str):
        self.w: B = None
        self.v: C = None
        self.x: B = None
        self.txt = txt

e = A("e")
c = B("c")
b = C("b")
m = D("m")
h = B("h")
l = A("l")
k = A("k")

e.o = l
e.s = c
e.y = b
e.p = m
c.w = l
b.x = m
b.s = e
b.u = k
m.w = h
m.v = b
m.x = c
h.w = e
l.o = e
l.s = c
l.y = b
l.p = m
k.o = l
k.s = c
k.y = b
k.p = m
assert l.y.u.p.v.u.o.txt == "
class A:
    def __init__(self, txt: str):
        self.o: A = None
        self.s: B = None
        self.y: C = None
        self.p: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.w: B = None
        self.v: C = None
        self.x: B = None
        self.txt = txt

e = A("e")
c = B("c")
b = C("b")
m = D("m")
h = B("h")
l = A("l")
k = A("k")

e.o = l
e.s = c
e.y = b
e.p = m
c.w = l
b.x = m
b.s = e
b.u = k
m.w = h
m.v = b
m.x = c
h.w = e
l.o = e
l.s = c
l.y = b
l.p = m
k.o = l
k.s = c
k.y = b
k.p = m
assert l.y.u.p.v.u.o.txt == "l"