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

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.v: C = None
        self.x: D = None
        self.y: C = None
        self.s: C = None
        self.txt = txt

n = A("n")
i = B("i")
l = C("l")
f = D("f")
c = E("c")
e = A("e")
m = B("m")
b = C("b")

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.v: C = None
        self.x: D = None
        self.y: C = None
        self.s: C = None
        self.txt = txt

n = A("n")
i = B("i")
l = C("l")
f = D("f")
c = E("c")
e = A("e")
m = B("m")
b = C("b")

n.y = f
n.o = l
i.p = l
i.u = m
i.z = e
i.o = b
l.y = c
l.u = i
f.w = n
c.z = i
c.v = l
c.x = f
c.y = b
c.s = b
e.y = f
e.o = b
m.p = b
m.u = i
m.z = n
m.o = l
b.y = c
b.u = m
assert i.p.u.o.u.o.y.txt == "c"