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

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

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

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

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

n = A("n")
a = B("a")
b = C("b")
i = D("i")
e = E("e")
c = C("c")

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

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

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

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

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

n = A("n")
a = B("a")
b = C("b")
i = D("i")
e = E("e")
c = C("c")

n.o = i
n.q = c
n.w = e
a.o = c
a.u = i
a.s = b
a.y = b
b.z = i
b.s = i
b.v = e
i.u = e
i.o = e
i.y = e
e.x = a
c.z = i
c.s = i
c.v = e
assert i.y.x.y.z.txt == "i"