class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.o: E = None
        self.r: B = None
        self.y: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.r: D = None
        self.y: E = None
        self.s: D = None
        self.p: B = None
        self.txt = txt

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

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

n.q = j
n.o = l
n.r = i
n.y = e
e.y = i
e.x = i
e.w = n
e.s = j
e.z = f
j.o = e
c.r = f
c.s = f
c.y = l
c.p = e
l.t = j
l.z = c
i.y = e
i.x = e
i.w = n
i.s = j
i.z = c
f.r = c
f.s = c
f.y = l
f.p = i
assert e.w.r.z.y.txt == "
class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.o: E = None
        self.r: B = None
        self.y: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.r: D = None
        self.y: E = None
        self.s: D = None
        self.p: B = None
        self.txt = txt

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

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

n.q = j
n.o = l
n.r = i
n.y = e
e.y = i
e.x = i
e.w = n
e.s = j
e.z = f
j.o = e
c.r = f
c.s = f
c.y = l
c.p = e
l.t = j
l.z = c
i.y = e
i.x = e
i.w = n
i.s = j
i.z = c
f.r = c
f.s = c
f.y = l
f.p = i
assert e.w.r.z.y.txt == "l"